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

Create the Window Controller

Create a new NSWindowController subclass called ConfigurationWindowController along with a corresponding XIB. Navigate to FileNewFile.... In the presented sheet, select Source from the OS X section and select Cocoa Class from the resulting options. Click Next. Enter ConfigurationWindowController in the Class field, and enter NSWindowController in the Subclass of field. Ensure that the checkbox labeled Also create XIB file for user interface is checked, and that Swift is the selected Language.

In ConfigurationWindowController.swift, add properties that you will bind the UI to, override windowNibName to load the proper NIB, and stub out the button action methods:

i​m​p​o​r​t​ ​C​o​c​o​a​ c​l​a​s​s​ ...

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