April 2015
Intermediate to advanced
556 pages
17h 47m
English
Currently, in
AppDelegate.swift, you create a window controller and pass in a string –
"MainWindowController". The string is the name of a NIB
file. When the project is launched, the window controller is created and the
objects in the named NIB file are unarchived along with their connections.
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var mainWindowController: MainWindowController?
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Create a window controller with a XIB file of the same name
let mainWindowController = MainWindowController(windowNibName:
"MainWindowController") // Put the window of the window controller on screen mainWindowController.showWindow(self) ...Read now
Unlock full access