Skip to content
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

Open
evadne opened this issue Mar 6, 2011 · 4 comments
Open

On cell reordering #50

evadne opened this issue Mar 6, 2011 · 4 comments

Comments

@evadne
Copy link
Collaborator

evadne commented Mar 6, 2011

Do you think it’s a good idea to move code from the Springboard example back to the grid view itself?

@lightandshadow68
Copy link

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.

@evadne
Copy link
Collaborator Author

evadne commented May 22, 2011

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.

@lightandshadow68
Copy link

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.

@evadne
Copy link
Collaborator Author

evadne commented May 22, 2011

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.

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

No branches or pull requests

2 participants