I created an NSCollectionView in a view controller within a window of my app. I implemented NSCollectionViewDelegate, specifically:
collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>)
This does work, but with a caveat: I have to first click on a blank space within the collection view's view, and then when I select a cell, it will call the method as expected. If I don't do this, nothing will happen when I select the cells. And I will have to do this every time I clicked something on that view controller that's outside the collection view.
Any idea?
The collection view does not take up the entire view controller, by the way, it's a subview of the NSViewController's view.