April 2015
Intermediate to advanced
556 pages
17h 47m
English
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 of the menu item to “Configure Die”.
Control-drag from the menu item to the First Responder.
Set the action to be showDieConfiguration:
(Figure 24.4). ...