This is Xcode 9.1 / Swift 4 version of https://github.com/klaas/CollectionViewElCapitan from two years ago:
Apple changed the way NSCollectionView
works in OS 10.11 as shown in the talk "What's New in NSCollectionView" at WWDC 2015. They also provide a complex example written in Objective-C: CocoaSlideCollection
This is a simple sample project written in Swift.
It uses the standard Cocoa Application template and has a single view controller containing two collection views. One is setup with Interface Builder. The other is coded programmatically. There are also two collection view items. Again, one inside a .xib file the other programmatically. They show simple labels. You can select and double click the items.