Scattered

Let’s create an application that uses Core Animation to drive the interface. This particular application will load all the images it finds in a folder and display them using CALayer objects (Figure 33.1).

Figure 33.1  Completed application

Completed application

In Xcode, create a new project called Scattered. Make sure that Swift is selected as the Language. You will be using a storyboard in this project, so check Use Storyboards. The project will not be document-based or use Core Data.

Open ViewController.swift and make the following additions:

i​m​p​o​r​t​ ​C​o​c​o​a​ c​l​a​s​s​ ​V​i​e​w​C​o​n​t​r​o​l​l​e​r​:​ ​N​S​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.