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

Support animated data reloading #10

Open
LinusGeffarth opened this issue Nov 1, 2017 · 2 comments
Open

Support animated data reloading #10

LinusGeffarth opened this issue Nov 1, 2017 · 2 comments

Comments

@LinusGeffarth
Copy link

LinusGeffarth commented Nov 1, 2017

I'd love to be able to update the collectionView's data on the go. I found this code does the job:

let range = Range(uncheckedBounds: (0, collectionView.numberOfSections))
let indexSet = IndexSet(integersIn: range)
collectionView.reloadSections(indexSet)

However, running this, makes the app crash at line 112 because of an unexpected nil:

override open func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
    return dynamicAnimator.layoutAttributesForCell(at: indexPath)!
}

I tried removing the ! to prevent the force-unwrapping of a nil variable, but that resulted in a generic terminating with uncaught exception of type NSException.

Any way we can update the data at runtime while viewing the collectionView?
I'm thinking of some cool animation: the cell that's to be removed scales down, then the cells below move up smoothly w/ a .easeOut curve. Would be awesome. Thanks!

@LinusGeffarth
Copy link
Author

@AppliKey, any chance for you to implement this? Thanks!

@ismaiI1
Copy link

ismaiI1 commented Dec 7, 2021

Any solution?

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