
Pay attention to File Owner . In your case, the File Owner should be MyViewController or its sub-class .
And the following codes if it is executed in the Foo class.
// If 'self' is an instance of 'Foo' class. // In this case, 'File Owner' will be a 'Foo' instance due to 'self' parameter. let myVC = NSBundle.mainBundle().loadNibNamed("MyViewController", owner: self, options: nil)[0] as? MyViewController
He assigns self as owner . So File Owner is Foo , not MyViewController . Then, for the Foo class, these IBOutlet cannot be connected to Foo . So this is the exception.
source share