How Can I Have The Second Container Show First
JayBone16 opened this issue · 3 comments
JayBone16 commented
git-hwa commented
@JayBone16 Maybe you can manually select the item at the first launch.
self.collectionView?.selectItem(at: IndexPath(row: 1, section: 0), animated: true, scrollPosition: UICollectionViewScrollPosition.left)
0ber commented
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
view.layoutIfNeeded()
collectionView?.selectItem(at: IndexPath(row: <CURRENT_INDEX>, section: 0), animated: true, scrollPosition: .centeredHorizontally)
}
JayBone16 commented
@ober01 Thanks it worked!