Im trying to preselect the first object/UICollectionViewCell in the UICollectionView? I have tried:
self.dateCollectionView.allowsMultipleSelection=NO;
[self.da
For me, putting it in viewDidAppear:
cause a second to select, so the user will see both states (i.e. not selected, and selected).
To avoid this, I put it in viewWillAppear:
instead and worked like a charm
override func viewWillAppear(_ animated: Bool) {
let selectedIndexPath = IndexPath(item: 0, section: 0)
collectionView.selectItem(at: selectedIndexPath, animated: false, scrollPosition: .left)
}