Giter VIP home page Giter VIP logo

Comments (4)

lightandshadow68 avatar lightandshadow68 commented on August 24, 2024

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.

from aqgridview.

evadne avatar evadne commented on August 24, 2024

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.

from aqgridview.

lightandshadow68 avatar lightandshadow68 commented on August 24, 2024

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.

from aqgridview.

evadne avatar evadne commented on August 24, 2024

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.

from aqgridview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.