Abhinav
Abhinav

Reputation: 38142

Setting re-ordering property of a cell to NO

Can we specifically set the re-ordering property of a cell (Add cell with + button) to NO? I cannot set editingStyle to NO as then I would not get even the + button in Add cell.

Upvotes: 0

Views: 177

Answers (2)

max_
max_

Reputation: 24481

Use the delegate method: tableView:canMoveRowAtIndexPath:.

You should use it by checking to see what the indexPath is and then return NO if the indexPath is the indexPath of a cell you do not want reorderingEnabled on.

Upvotes: 1

nevan king
nevan king

Reputation: 113747

You can set a cell's showsReorderControl to NO, implement tableView:moveRowAtIndexPath:toIndexPath:and return NO for tableView:canMoveRowAtIndexPath:.

http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableViewCell/showsReorderControl

Upvotes: 0

Related Questions