KelvinJin / AnimatedCollectionViewLayout

A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.
MIT License
4.74k stars 350 forks source link

Allow subclassing of AnimatedCollectionViewLayout #34

Closed Voxar closed 5 years ago

KelvinJin commented 7 years ago

Hey, thanks for the PR. However, I'm not sure allowing people to subclass the layout would help much. If there're features that you need to subclass to achieve, then maybe add them to the base class?

Voxar commented 7 years ago

Hi. Thanks for your comment.

I'm just interested in func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint really, to make a custom pagination to get "flick fast scroll" functionality. Works pretty good together with LinearCardAttributesAnimator.

Which approach would you suggest?

KelvinJin commented 7 years ago

Hey Voxar. That sounds like a very interesting feature to have in this library. Do you think we can add that as a plugin/optional feature that if you want you can turn it on?

kamendo commented 5 years ago

Please merge, I need this one

gsbernstein commented 5 years ago

Please merge this, I just closed a similar PR. This is necessary to use other features of UICollectionViewFlowLayout like finalLayoutAttributesForDisappearingItem and initialLayoutAttributesForAppearingItem to customize the appearing and dismissing of cells. Right now I am resorting to copying the entire class into my project.

You don't need to add these as features to this library, you just need to allow people to override them like you normally would when subclassing UICollectionViewFlowLayout.

KelvinJin commented 5 years ago

@kamendo @gsbernstein Thanks guys and good point. I'll merge this and release a new version as soon as I get home today (in about 8 hours).

gsbernstein commented 5 years ago

Thank you! Impressed by your responsiveness.

KelvinJin commented 5 years ago

@gsbernstein @kamendo @Voxar This is now merged and released in version 0.5.0. Don't forget to update your Cocoapods specs by running pod repo update! Thanks again guys.

kamendo commented 5 years ago

Works great! 10q!