0

The latest update to NSCollectionView allows the delegate to detect the selection of items with

- (NSSet<NSIndexPath *>*)collectionView:(NSCollectionView*)collectionView shouldSelectItemsAtIndexPaths:(NSSet<NSIndexPath*>*)indexPaths

and

- (void)collectionView:(NSCollectionView*)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath*>*)indexPaths

, among others.

However, insofar as I can tell, these methods only detect the selection of NSCollectionViewItem objects, and not any present header or footer views.

Are there any delegate methods to detect the selection of the header and/or footer views? If not, what is the best way to implement this detection?

Stuart Barth
  • 301
  • 2
  • 10

1 Answers1

0

Indeed these delegate methods are only for selecting items. If you want to do something when the header of footer view is clicked, you can add a gesture recognizer to those views yourself and hook it up to an IBAction on your controller.

Juul
  • 642
  • 4
  • 18