I want change the cells order in my tableview
I am using following code
-(void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
[tableView moveRowAtIndexPath:path1 toIndexPath:path2];
}
here path1 indexpath of row which user selected now I want find the indexpath of the row the user drop that cell so how can I find that toIndexPath(path2).
I think you’re confused with the purpose of this method – this is a callback function of the UITableViewDataSource that’s designed to notify the data model of changes in the table. From the docs:
This means that what you need to do here is to make sure your model (Usually an array) is rearranged to sync properly with these changes.
Hope this gives you a good direction.