-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On cell reordering #50
Comments
While being a very helpful starting point for this sort of functionality, I've found the reordering logic in the Springboard example did not need my reordering needs For example, I'm currently struggling to get reordering, addition and deletion working with items that are sorted by position. In this case, reordering items needs to recalculate and update the sort property the underlying model objects in the grid when the gesture has ended. If this were moved into the grid view, it would either need to be made more generic to handle a reasonably wide range of use cases or I'd need to subclass AQGrid view. |
As an update, I’ve implemented reordering, insertion, updating and deletion all from the calling class instead of in the grid view itself. Sorting is handled by the data source which respects a phantom cell. |
Are you referring to AQDataSource or your data source class? Currently, I'm using AQGridCell with an instance of NSFetchedResultsController. I've managed to get reordering working. However, attempting to add and remove cells the grid is either removing duplicate cells with the same displayIndex, which leaves blank cells, or it's throwing a inconstancy exception. This is likely due to the fetched results controller calling add / remove / update calls while tracking changes to the fetched data. Making AQDataSource aware of the phantom cell sounds like a good solution. |
Custom data source. Just making sure that adding / removing cells do not happen at the same time that reordering is taking place should be adequate. |
Do you think it’s a good idea to move code from the Springboard example back to the grid view itself?
The text was updated successfully, but these errors were encountered: