I'm learning how to use storyboards for iOS development and I can't seem to figure out how to manage multiple views on the same screen.
I want to be able to control multiple elements on the same screen, for example a UITableView
with an UIImageView
next to it.
This means I need 3 UIViewControllers
, 1 for the UITableView
, 1 for the UIImageView
, and one for the main view. But as far as I can tell storyboards only allow for 1 controller per view hierarchy screen. Can anyone tell me what I'm missing?
View Controller Containment is the way to go. Have a look at Apple's documentation about it:
Creating Custom Container View Controllers
Container view controllers are a critical part of iOS app design. They allow you to decompose your app into smaller and simpler parts, each controlled by a view controller dedicated to that task. Containers allow these view controllers to work together to present a seamless interface.
You can use it in storyboards as well by using a container view.
Useful tutorial: Storyboards With Custom Container View Controllers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With