zepojo/UPCarouselFlowLayout

connect carousel with pageView

Opened this issue · 2 comments

hi, first of all, thanks for your work! the carousel is working nice for my app.

i want to connect the carousel with my pageView. My carousel just got a label with headings in it and when i swipe left or right i can change between different pageViews. Now i want to connect the heading-labels with my pages, like the pageViewController

so i want to swipe the headings "audio","netzwerk","player" together with the pageView
it looks like this

pageviewcontroller kopie

hi,
sorry, i solved my problem with https://github.com/PageMenu/PageMenu
that is exaclty what i was searching for.
but thanks anyway for your programm!

I know it has been asked a long time ago, but if anyone face this problem too, I solved it by getting the indexPath of the center UICollectionViewCell.

func scrollViewDidScroll(_ scrollView: UIScrollView) {
        let center = CGPoint(x: scrollView.contentOffset.x + (scrollView.frame.width / 2), y: (scrollView.frame.height / 2))
        if let ip = self.collectionView!.indexPathForItem(at: center) {
            self.pageControl.currentPage = ip.row
        }
}