Skip to content

Instantly share code, notes, and snippets.

@aresnick
Created January 18, 2018 16:43
Show Gist options
  • Save aresnick/811d255349ac294a9399b270df5d1982 to your computer and use it in GitHub Desktop.
Save aresnick/811d255349ac294a9399b270df5d1982 to your computer and use it in GitHub Desktop.

CollectionViewSwift4

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment