I have a View controlled by WorkController (derived from UIViewController)
On the view I have a subview myCollection of type UICollectionView
Due to complexity of handling the collection I created a separate controller MyCollectionController.
How do I (in Interface Builder, XCode 4.5 ) set my subview’s controller to MyCollectionController ? I also need to set the delegate and the source.
I did not find a way to do it in Interface Builder so now I just do it programmatically.
On viewDidLoad of the WorkController I create an instance of MyController and set all connection between it and the myCollectionView.
But how to do it with IB ?
thanks
I would consider leaving
WorkControlleras the view controller for the subview so that you can create connections easily in IB and obtain an IBOutlet reference to the subview. Then, when the view loads, you can haveWorkControllercreate a separate object (NSObject subclass) that serves as the data source and delegate for yourUICollectionView.The benefit of this is that your view controller manages the whole display, as Apple suggests, while employing a reusable object to off-load some of the view management.