O'Reilly logo
  • Jamie Robillard thinks this is interesting:

​ ​o​v​e​r​r​i​d​e​ ​v​a​r​ ​w​i​n​d​o​w​N​i​b​N​a​m​e​:​ ​S​t​r​i​n​g​?​ ​{​ ​ ​ ​ ​ ​ ​ ​ ​r​e​t​u​r​n​ ​"​M​a​i​n​W​i​n​d​o​w​C​o​n​t​r​o​l​l​e​r​"​ ​ ​ ​ ​}

From

Cover of Cocoa Programming for OS X: The Big Nerd Ranch Guide

Note

This will not work on Xcode 9 the I used the following solution:

override var windowNibName: NSNib.Name? { return NSNib.Name(rawValue: "MainWindowController") }