Skip to content

Commit

Permalink
Add new item at correct index in its parent
Browse files Browse the repository at this point in the history
  • Loading branch information
Augustyniak committed Aug 30, 2016
1 parent cec732e commit 32f0b71
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class TreeViewController: UIViewController, RATreeViewDelegate, RATreeViewDataSo
let item = treeView.itemForCell(cell) as! DataObject
let newItem = DataObject(name: "Added value")
item.addChild(newItem)
treeView.insertItemsAtIndexes(NSIndexSet.init(index: 0), inParent: item, withAnimation: RATreeViewRowAnimationNone);
treeView.insertItemsAtIndexes(NSIndexSet.init(index: item.children.count-1), inParent: item, withAnimation: RATreeViewRowAnimationNone);
treeView.reloadRowsForItems([item], withRowAnimation: RATreeViewRowAnimationNone)
}
return cell
Expand Down

0 comments on commit 32f0b71

Please sign in to comment.