3 Replies
      Latest reply on Feb 16, 2019 12:54 AM by Tom1234
      Tom1234 Level 1 Level 1 (0 points)

        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.