Set Up the Menu Item
Open MainWindowController.swift and,
near the bottom of the definition of MainWindowController,
add a new section Actions
and a stub for an @IBAction
.
// MARK: - Actions @IBAction func showDieConfiguration(sender: AnyObject?) { println("Configuration menu item clicked") }
Open MainMenu.xib and add a menu item to the main menu for your application by dragging it out of the object library (Figure 24.3).
Figure 24.3 Adding a menu item
Change the title ...
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.