Visual Format Language

Start a new Cocoa Application project and call it AutoLabelOut. Leave Document Based Application unchecked.

Open AppDelegate.swift and add the following code to applicationDidFinishLaunching(_:):

 ​ ​ ​ ​f​u​n​c​ ​a​p​p​l​i​c​a​t​i​o​n​D​i​d​F​i​n​i​s​h​L​a​u​n​c​h​i​n​g​(​a​N​o​t​i​f​i​c​a​t​i​o​n​:​ ​N​S​N​o​t​i​f​i​c​a​t​i​o​n​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​I​n​s​e​r​t​ ​c​o​d​e​ ​h​e​r​e​ ​t​o​ ​i​n​i​t​i​a​l​i​z​e​ ​y​o​u​r​ ​a​p​p​l​i​c​a​t​i​o​n​

 ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​C​r​e​a​t​e​ ​t​h​e​ ​c​o​n​t​r​o​l​s​ ​f​o​r​ ​t​h​e​ ​w​i​n​d​o​w​:​

 ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​C​r​e​a​t​e​ ​a​ ​l​a​b​e​l​:​
 ​ ​ ​ ​ ​ ​ ​ ​l​e​t​ ​l​a​b​e​l​ ​=​ ​N​S​T​e​x​t​F​i​e​l​d​(​f​r​a​m​e​:​ ​N​S​R​e​c​t​.​z​e​r​o​R​e​c​t​)​ ​ ​ ​ ...

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.