aataraxiaa / ScalingCarousel

A super simple carousel view with scaling transitions written in Swift
MIT License
756 stars 98 forks source link

Wrong cell position after navigation #61

Closed omate94 closed 4 years ago

omate94 commented 5 years ago

After navigation the cell is not centered. Just after I add scaling carousel view inset.

dogo commented 5 years ago

https://github.com/superpeteblaze/ScalingCarousel/issues/53#issuecomment-442558875 Patch

Rahul379 commented 5 years ago

Still facing issue for second cell, but working fine for other cells. When on second cell after navigating back cell is centered but row value is return 0 which should be 1.

Below code for reference: func scrollViewDidScroll(_ scrollView: UIScrollView) { carouselView.didScroll() guard let currentCenterIndex = carouselView.currentCenterCellIndex?.row else { return } print(currentCenterIndex) pageControl.currentPage = currentCenterIndex }

aataraxiaa commented 4 years ago

As per the readme

Set your UIViewController as the collection view delegate and implement the UIScrollViewDelegate method scrollViewDidScroll(:). In this method, call the didScroll() method of ScalingCarouselView