Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
Create the Window Controller
Create a new NSWindowController subclass
called ConfigurationWindowController along with a corresponding XIB.
Navigate to
File → New → File....
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:
import Cocoa class ConfigurationWindowController: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access