O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required