In a Swift test project, I subclass NSWindowController. My subclass is NSWindowControllerdesigned to work with a specific Nib file. Therefore, it is advisable that when initializing my window controller, the nib file is automatically loaded by the instance of the window controller. In Objective-C, this was accomplished by doing:
@implementation MyWindowController
- (id)init {
self = [super initWithWindowNibName:"MyWindowNib"]
if (self) {
}
return self
}
@end
Now, in Swift this is impossible: init()it cannot call super.init(windowNibName:), because later it is declared not as a designated initializer, but as convenient for NSWindowController.
How can this be done in Swift? I do not see how to do this.
P.S.: , , , Window Controller, init(windowNibName:). , , . init(), , "" Nib .