Last active
August 29, 2015 13:56
-
-
Save simonnickel/9048440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - SNLInteractionTableView delegate - Reorder | |
- (void)startedReorderAtIndexPath:(NSIndexPath *)indexPath { | |
// additional setup when reordering starts | |
NSLog(@"Reordering started"); | |
} | |
// Update your data source when a cell is draged to a new position. This method is called every time 2 cells switch positions. | |
- (void)moveRowFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { | |
// update DataSource when cells are switched | |
NSLog(@"Switched Cells"); | |
// Reorder example: | |
id object = [self.itemList objectAtIndex:fromIndexPath.row]; | |
[self.itemList removeObjectAtIndex:fromIndexPath.row]; | |
[self.itemList insertObject:object atIndex:toIndexPath.row]; | |
} | |
- (void)finishedReorderAtIndexPath:(NSIndexPath *)indexPath; { | |
// additional cleanup when reordering ended | |
NSLog(@"Reordering ended"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment