-
Notifications
You must be signed in to change notification settings - Fork 0
TableNode Class's Method
override func removeFromParent()When you remove the TableNode from it's parent. This method is used. There is also a deinit when TableNode is nil. This method removes the gesture, and calls the super removeFromParent().
func reloadData()This function organizes the cells in their respective index. Besides that, adds the cells as child of the TableNode. At the end, calls the setCellsPosition()function.
func dequeueReusableCell(withIdentifier identifier: String, for indexPath: IndexPath) -> TableNodeCellThis should be used inside tableNode(_ tableNode: TableNode, cellForRowAt indexPath: IndexPath) -> TableNodeCell function. This gives the identifier for the cell and the index. It returns the cell built.
@objc func handlePan(sender: UIPanGestureRecognizer)This is what happens with the cells when the user makes a pan gesture.
Warning: This method may be changed in the future. Today is fine how the way it is, but I really feel that can be better.
func setCellsPosition()This ruction sets the positions of the cells. It passes through the sections and rows, putting every cell where should be. It is dependent of previousCellPosition variable to work properly.