I know this question has a lot of Swift-related issues in it, and that will be covered later, but…
In the AppDelegate book example in Chapter 1 we seem to do a much of var/let dancing. I wonder considering the MainWindowController is going to be instantiated right away anyways if this might be a more lean implementation.
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
let mainWindowController = MainWindowController(windowNibName: "MainWindowController")
func applicationDidFinishLaunching(aNotification: NSNotification) {
mainWindowController.showWindow(self)
}
}
I suppose there is a risk the MainWindowController init might fail (maybe a typo in that string) but I’d consider that a compile time behavior not a run time behavior.