0
votes

I've a problem with UITableView. When I'm in editing mode i want to reorder the cell but e when I drag a cell at the bottom of the screen it's allowed to go down as much as the TableView height and down the last tableViewCell. I've only 4 cell and i want that when Im dragging a cell it's not allowed to go down after the fourth cell.

Can Anyone help me?!?

1

1 Answers

0
votes

Hey I know it's an old post but I have encountered this problem and here's what I found this method from UITableViewDelegate. You can block your cell by doing something like:

- (NSIndexPath *)tableView:(UITableView *)tableView 
       targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath 
       toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath {

    if (sourceIndexPath == [NSIndexPath indexPathForRow: YOUR_ROW_NUMBER inSection: YOUR_SECTION_NUMBER])
        return sourceIndexPath;
    else
        return proposedDestinationIndexPath;
}

Hope this helps someone

Cheers