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

CompositionalLayout - Feature Request #30

Open
egenvall opened this issue Apr 27, 2020 · 0 comments
Open

CompositionalLayout - Feature Request #30

egenvall opened this issue Apr 27, 2020 · 0 comments

Comments

@egenvall
Copy link

Hi,

Gemini seems to be not working when using a UICollectionViewDiffableDataSource along with a UICollectionViewCompositionalLayout.

The scrolling function
func scrollViewDidScroll(_ scrollView: UIScrollView)
is not called on scroll in these layouts by design, rather:

section.orthogonalScrollingBehavior = .groupPagingCentered
section.visibleItemsInvalidationHandler = { visibleItems, scrollOffset, layoutEnvironment in
                 self.collectionView.animateVisibleCells()  
}

is used to detect scrolling for each section, but calling the animation function seems to only do the animation once initially.

I'm also calling the animation in

func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {

        guard let customCell = cell as? MyCollectionCell else { return }
        self.collectionView.animateCell(customCell)
}

and its set as

collectionView.gemini.customAnimation().translation(x: 0, y: 50, z: 0).rotationAngle(x: 0, y: 13, z: 0).ease(.easeOutExpo)
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

1 participant