Ramotion/expanding-collection

How Can I Have The Second Container Show First

JayBone16 opened this issue · 3 comments

How can I have the first index show instead of the zero index?

How It Shows Up When It Runs:
screen shot 2016-10-10 at 2 37 31 pm

How I want it to start up like:
screen shot 2016-10-10 at 2 37 35 pm

@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)
  }

@ober01 Thanks it worked!