Last active
August 29, 2015 13:56
-
-
Save simonnickel/9048440 to your computer and use it in GitHub Desktop.
Revisions
-
simonnickel renamed this gist
Jun 6, 2014 . 1 changed file with 13 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,22 @@ #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"); } -
simonnickel revised this gist
Feb 17, 2014 . 1 changed file with 3 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,15 @@ - (void)moveRowFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { // Reorder example: id object = [self.itemList objectAtIndex:fromIndexPath.row]; [self.itemList removeObjectAtIndex:fromIndexPath.row]; [self.itemList insertObject:object atIndex:toIndexPath.row]; } /* if needed - (void)startedReorderAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"Reordering started"); } - (void)finishedReorderAtIndexPath:(NSIndexPath *)indexPath; { NSLog(@"Reordering ended"); } */ -
simonnickel created this gist
Feb 17, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ // 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 { /* * Reorder example: */ id object = [self.itemList objectAtIndex:fromIndexPath.row]; [self.itemList removeObjectAtIndex:fromIndexPath.row]; [self.itemList insertObject:object atIndex:toIndexPath.row]; } /* Uncomment this function if you need additional setup when reordering starts. - (void)startedReorderAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"Reordering started"); } */ /* Uncomment this function if you need additional cleanup when reordering ended. - (void)finishedReorderAtIndexPath:(NSIndexPath *)indexPath; { NSLog(@"Reordering ended"); } */