This is the code I demonstrated in my talk “iOS 5 UIViewController containment” at iPhoneDevCon 2011.
Slides for this talk are online at Speaker Deck.
Peter’s example is awesome for learning this stuff! I updated the code and slimmed it down to a minimum:
- use a Storyboard instead of a .xib file
- don’t @synthesize
- use lazy instanciation
- a custom initializer for SampleView
- removed all methods that don’t do anything
- fixed some typos