In iOS they have something called a Container View these days which is pretty much just a UIView but you can connect it through an embed segue to another UIViewController - sounds awesome!

You most likely need to access the child controller from the parent view controller...but how? You would think that you the child view controller would be accessible as a property of the container view (similar to a UIPopoverViewController). i.e:


But this is not actually the case! I found the answer from DAXaholic on SO:

So you need to use the prepareForSegue delegate method which actually makes sense because it's connected with an embed segue in the storyboard ...I just wasn't expecting it at the time!

Here is my implementation in Swift:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

if let photosCollectionController = segue.destinationViewController as? AddedPhotosCollection{

    myCollectionViewController =photosCollectionController}