I have a custom UIViewController in Interface Builder (in my storyboard) and I want to add this view I assembled into another view programmatically. I have made a class for the view controller I made but simply importing and adding that custom class as a subview doesn’t appear to work.
I have a custom UIViewController in Interface Builder (in my storyboard) and I want
Share
You’ll need to load an instance of the view controller from the UIStoryboard object and add it’s view as a subview. That code would look something like this:
Make sure you set the identifier field for your view controller in IB and pass that to the “instantiateViewControllerWithIdentifier” method.