I have sucessfully implemented a 10.11 version of NSCollectionView in my Mac app. It displays the 10 items that I want, but I want the first item to be automatically selected when the app starts.
I have tried the following in the viewDidLoad and alternatively in the viewDidAppear functions;
let indexPath = NSIndexPath(forItem: 0, inSection: 0)
var set = Set<NSIndexPath>()
set.insert(indexPath)
collectionView.animator().selectItemsAtIndexPaths(set, scrollPosition: NSCollectionViewScrollPosition.Top)
I have tried line 4 above with and without the animator
I have also tried the following in place of line 4
collectionView.animator().selectionIndexPaths = set
with and without the animator()
While they both include the index path in the selected index paths, neither actually displays the item as selected.
Any clues where I am going wrong?