-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[ASTableView] Add Support for Interactive Reordering #2221
Conversation
@Adlai-Holler Awesome work on this, curious if this would be something fairly easy to add support for under UICollectionView interactive movement? #2117 |
a44e7e7
to
af1baa6
Compare
@ay8s Great idea! I've updated the diff to add support for collection view reordering as well. |
Nice @Adlai-Holler. Going to give this a go and see if it fixes the issues I was seeing. Curious if you know if it'd be possible to relayout the items when reordering is initiated to shrink the cells a little to make ordering quicker for the user as some of our cells are quite large so may explore hiding nodes or truncating the ASCellNode to a set height? Might be out of the scope of AsyncDisplayKit. |
@Adlai-Holler Curious if you're seeing an assertion failure when moving within the ASCollectionView?
|
@ay8s Thanks for testing this out!
|
ASCellNode *node = oldSection[indexPath.item]; | ||
[oldSection removeObjectAtIndex:indexPath.item]; | ||
[internalCompletedNodes[newIndexPath.section] insertObject:node atIndex:newIndexPath.item]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you simplify this duplication with an inline function or method or something?
Looks good and really simple! |
@Adlai-Holler Probably could have done a better job at an example here but if you move the items around a few times you should run into that assertion failure. I'm working on implementing it still using a custom flow layout to move the cells as you scroll. Example: https://cl.ly/2w1Y1b3i3f1c |
d9ada96
to
3aa03ac
Compare
@ay8s OK great, your sample app helped me iron out some remaining issues with interactive movement. Thank you! I never reproduced the assertion failure you mentioned. Now, with the latest code, the interactive movements and reloadDatas seem to be running very well. |
@Adlai-Holler Glad I could help with something. Will give it a whirl tomorrow and see how it fairs in the Buffer iOS app. Will try and put together something if I come across any oddness. Edit: @Adlai-Holler curious if you have a demo for this at all? I tried hooking it up and while it doesn't trigger any crashes now it doesn't seem to handle cells of different heights too well which could totally be down to requiring a relayout. The cells seem to overlap and sometimes vanish during/after a reorder. |
44153ca
to
0280bf0
Compare
@ay8s Hi! I continued building collection view reordering support, but unfortunately it's going to take more development and testing than I think belongs in this diff. So I reduced this diff back to just table view reordering and I'll land it. I left the AHCollectionReordering branch up so we don't lose the knowledge gained. Here's an info dump about what will be required for collection view interactive reordering:
@ay8s Hopefully I or someone on the team can get collection view interactive reordering built soon. If you're interested in working on it, please ping me on the asyncdisplaykit slack channel! We can pick up the discussion at #2117 |
@Adlai-Holler Sounds good. We actually ended up switching back to the table view as it seems to handle orientation changes and bounds changes a little smoother for our next release. I believe we'll still need the CollectionView reordering in the future however so I'll be sure to ping you if I get chance to take a look. Still early days with ASDK so keen to get to grips with more of it. Thanks for exploring it as far as you did! 👍 |
No description provided.