Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Container View Controller Examples [closed]

Can anyone point me to any good examples of creating a Custom View Controller as a Container View Controller? The only documentation I can find is a couple of paragraphs in the UIViewController Class Reference. I feel I need a little more information than that and an example implementation would be nice. Google has turned up nothing at all.

I am specifically interested in the method:

transitionFromViewController:toViewController:duration:options:animations:completion: 
like image 504
Undistraction Avatar asked Oct 13 '11 14:10

Undistraction


People also ask

What is a container view controller?

Container view controllers are a way to combine the content from multiple view controllers into a single user interface. Container view controllers are most often used to facilitate navigation and to create new user interface types based on existing content.

Is a viewController a view?

A view controller manages a single root view, which may itself contain any number of subviews. User interactions with that view hierarchy are handled by your view controller, which coordinates with other objects of your app as needed. Every app has at least one view controller whose content fills the main window.

What is a container view Swift?

Unlike a content view controller that displays your app's data, a container view controller displays other view controllers, arranging them onscreen and handling navigation between them. A container view controller is still a view controller, so you display it in a window or present it like any other view controller.

What is UIViewController in iOS?

The UIViewController class defines the shared behavior that's common to all view controllers. You rarely create instances of the UIViewController class directly. Instead, you subclass UIViewController and add the methods and properties needed to manage the view controller's view hierarchy.


2 Answers

The best thing I have found so far is the WWDC 2011 Session Video Session 102 - Implementing UIViewController Containment.

like image 125
hypercrypt Avatar answered Oct 05 '22 23:10

hypercrypt


In addition to the WWDC Session Video Session 102 - Implementing UIViewController Containment that hypercrypt already mentioned, Apple WWDC 2012 session on "The Evolution of View Controllers on iOS" also covers this topic and the example code is part of the sample code package:

https://developer.apple.com/devcenter/download.action?path=/wwdc_2012/wwdc_2012_sample_code/wwdc_2012_session_code.dmg

There's also an example here: https://github.com/toolmanGitHub/stackedViewControllers

like image 23
JosephH Avatar answered Oct 05 '22 23:10

JosephH