Skip to main content

Three UIViewControllers on the same window



I want to develop the following application: on top I have a navigation bar, in the middle a TableViewController and on the bottom I have a custom control that is actually a slider (when I move the slider I want to present another TableViewController - but my navigation bar remains the same). And when I select a cell in the TableView I want to push a new ViewController (so I will change my navigation bar) and I will also dismiss my custom control. I have attached a picture of the prototype of my application.How would you suggest that I should implement this? My custom control is designed using IB so I think I should use the old way, using .xib files, not the Storyboard. enter image description here




Comments

  1. Do you really mean separate view controllers? Everything you've described could be handled with views, in a way that's compatible with all recent versions of iOS

    If you really want the 3 parts of your screen to use separate view controllers, you can really only do that under iOS 5 (or later). Starting with iOS 5, view controllers can contain other "child" view controllers. You can create your own container view controller.

    Look at the method addChildViewController: to set up view controllers as children of hte current view controller. You add all your children first, and then add their content views as subviews of the parent view controller.

    It sounds to me like you would want a navigation controller who's root view controller is a container view controller with multiple child view controllers. If you want to swap out one of the children, use transitionFromViewController:toViewController:duration:options:animations:completion: to switch child view controllers.

    ReplyDelete

Post a Comment

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.