Closed conanm closed 2 years ago
It's pretty simple. I did it implementing Instagram Stories behaviour. All you need is force render collectionView of presented fullscreen VC
override func viewDidLoad() {
super.viewDidLoad()
collectionView.layoutIfNeeded() // force load cells before scrolling to the index
collectionView.scrollToItem(at: IndexPath(item: selectedIndex, section: 0), at: .centeredHorizontally, animated: false)
}
I want to transition from a ViewController to a ViewController with a CollectionView that pages horiziontally and presents cells as fullscreen views to paginate through 100s of model objs. It would work smoothly if I could dequeue the cellForItemAtIndexPath and then transition (using hero IDs) from the existing screen to the cell. The problem is, to dequeue the cell it needs to be visible. So again,
Anyone implement this use case? Some ways I could do it:
Thanks.