Reputation: 4171
Fairly new to iPhone/Cocoa development, so I'm having difficulty adjusting.
I want to create a ViewController that has two separate subViews. Kind of how the TabViewController/NavigationController is set up, but I want to be able to control what's in the other portion as well (not to mention sizing, etc.). Either orientation is fine (top/bottom) or (left/right).
+--------+ +----+----+
| top | | l | r |
| | | e | i |
+--------+ | f | g |
| | | t | h |
| bottom | | | t |
+--------+ +----+----+
Upvotes: 1
Views: 4741
Reputation: 10722
You can create a subclass of ViewController and add three properties:
FirstView, SecondView, isVertical
These three properties will in general be enough to create a simple split view. The consumer would be responsible for setting up those properties, and inside of your ViewController's loadView method, you would add both of those views to a new view, which you would then assign to the "view" property of the UIViewController.
That's really all there is to it for a extremely limited feature set Split ViewController. The rest of the features would mostly likely just customize how the views are sized and positioned.
Hope this helps, and please open source it :)
Upvotes: 3