raweng/StackScrollView — Issue #30: unable to reorder using default table reordering methods
Author: djgooner
Created: 2011-12-12 16:51:52+00:00
State: open

Take the sample app from the github, and place the following in the dataviewcontroller class.

//this in the - (id)initWithFrame:(CGRect)frame
[_tableView setEditing:YES];

// then these two methods.
#pragma mark Row reordering
// Determine whether a given row is eligible for reordering or not.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}

// Process the row move. This means updating the data model to correct the item indices.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{

}

i see the table with the reordering indicators. but nothing happens when i try to drag. but put a breakpoint on the second method, moveRowAtIndexPath. and tap on the three line icon for reordering, the method gets called. So something is stopping from selecting and dragging. i am still looking in to this but if anyone has any suggestions will be greatly appreciated.