Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should Storyboard References work with Container Views?

I just tried it out and it doesn't seem to work, see picture. However, there is error or warning, and since a reference is a view controller - should it be possible?

enter image description here

like image 503
brainray Avatar asked Oct 18 '22 21:10

brainray


1 Answers

Setting up a parent/child relationship with a container view is easy.Just create a container view inside the parent ViewController, create the child view controller scene, and then control-drag from the container view to the child view controller to create the embed segue.

If you want to swap the child view controllers depending on some condition, i.e. multiple child view controllers, just create a custom segue. This custom segue is named Empty and is a subclass of UIStoryboardSegue with empty perform method.

like image 153
Sagar D Avatar answered Nov 15 '22 05:11

Sagar D