I am using UAModalPanel to create a popover controller effect. I can get the popver box to display, but I am struggling to figure out how to create a view (graphically, in storyboard), instantiate that view in code, and add it to the UAModalPanel.
What I’ve Tried
- Created a UIViewController in storyboard, set it’s class to a custom class, instantiated that class in code, got it’s view and tried to add it to the current ‘scene’.
That’s it. Surely there is a way that I can make a view in storyboard, have it make a sub-class of UIView which I can then grab in code where I need to use it? Instead of laying it out in code?
In storyboards you’ll want to drag and drop a new
UIViewControllerthen give it an identifier here:Then in code you can get the view property of this view controller with the following:
Now you can get the conrollers view property and make adjustments. Here’s an example of frame change