I have a UITableView within which I am allowing the user to re-order cells. All cells can be re-ordered except the top row, which must always remain as the top row.
I have used the canMoveRowAtIndexPath method to prevent the top row from being moveable. However, I can’t see a way to prevent the user from dragging any of the other rows and dropping them above the top row, thus breaking my top-row requirement.
How do I stop users being able to drag other rows above the top row?
Thanks.
There is a UITableViewDelegate method that allows you to amend the destination index path if it doesn’t meet your requirements. I think this should work: