Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[ASTableView] Moving cells with the reorder control does not work #2258

Closed
skensell opened this issue Sep 16, 2016 · 4 comments
Closed

[ASTableView] Moving cells with the reorder control does not work #2258

skensell opened this issue Sep 16, 2016 · 4 comments

Comments

@skensell
Copy link

Trying to move cells around with the reorder control by calling [self.tableNode.view setEditing:YES]; in viewDidLoad and then implementing

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {
    // modify backing data
}

does not seem to work. I'm following Apple's docs.

The row animates to the correct location, however, if I scroll down and scroll back up again the rows are back in their original locations. I guess this is because ASTableView's internal ASDataController has not been notified of the move.

The only workaround I have is calling reload on every cell between the source and destination (which results in a flash and is quite ugly).

@hannahmbanana
Copy link
Contributor

@skensell: I believe support for this was just added to master (#2221). Does this work for you?

@skensell
Copy link
Author

Wow, nice timing! As far as I can tell, I can only integrate master if I'm using Carthage, is that right? I'm using Cocoapods and it seems 1.9.90 is the latest there. Does that include the change?

@skensell
Copy link
Author

Also, is there an E.T.A. for 2.0? Just curious :)

@hannahmbanana
Copy link
Contributor

@skensell: I'm not sure about Carthage, but you are correct that 1.9.90 is the latest on Cocoapods which does not include this recent change.

2.0 is coming soon...within the next few weeks. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants