Search code examples
iosxcode-storyboard

How to set the controller for a subview in storyboard?


I have a view in my storyboard to which I've added a UICollectionView. Is it possible (using Interface Builder only) to assign to my collection view a different controller than the controller that I use for the view that contains it?

I am using XCode 6.1.


Solution

  • I was able to do it by removing the UICollectionView, and replacing it with a Container view. Then, I created a separate collection view controller, and linked it to the container view with an embed segue (ctrl-drag from the container view into the collection view controller, and choose embed).