I'm trying to load a ViewController (a custom UIViewController subclass) from an .xib in Swift via the storyboard (I created a ViewController instance in the storyboard and deleted its view).
The ViewController itself loads, but nothing in the .xib loads with it.
In other words, my .xib looks like this:
ShapeView is a custom UIView subclass.
But if I look at the view which is actually loaded:
override func awakeFromNib() {
log.info("view \(self.view)")
}
self.view is just a generic UIView -- it's not my ShapeView.
If I try creating an @IBOutlet and connecting my ShapeView to it, the same thing happens -- the property bound to the outlet is nil:
If I use Obj-C for my ViewController class keeping everything else the same (the .xib and storyboard), it works as expected.
How do I set up and/or load the .xib in Swift via the storyboard to get the correct behavior?