Reputation: 3300
I have a container view in a view controller (lets say A) with an embed segue to a view controller (lets says B) which is in the same storyboard. Now the requirement is I have to use this same embedded view controller B in another container view in view controller C which is in different story board. Is it possible to reuse view controller B in multiple container views ?
Upvotes: 3
Views: 2734
Reputation: 536
1) For view controller B, add a storyboard identifier
2) Add a container view inside view controller C
3) Delete the view controller that is embedded to View Controller C
4) Add a "Storyboard Reference" next to view controller C, then drag from the container view inside view controller C to the storyboard reference and create an "Embed" segue
5) Select the storyboard reference and set the "Reference ID" to match view controller B's identifier. Also make sure "Storyboard" has the name of the storyboard that view controller B is in.
Upvotes: 4
Reputation: 482
You can drag a Storyboard Reference
in that different storyboard
, and set it's Storyboard
and Referenced ID
properties to the view controller B
.
Upvotes: 0