0

I have a UIViewController with a UISegmentControl with 3 buttons/segments.

If I place a smaller UIView in the main view in the storyboard. Can I display content from 3 other UIViewController classes in this UIView depending on the UISegmentControl current segment?

I have to ask because just read something about not displaying another UIViewController in a UIViewController. And this is the scene I'm working on:

http://www.flickr.com/photos/80427098@N07/7859459430/in/photostream

So if my picture scene is a bad way of doing it, my question is:

Is there another way of displaying the content of UIViewController 1,2 and 3 according to the UISegmentControl?

I am stuck so I need some quick guidelines on how to do this in an approved and working way, as the 3 scenes are very different to each other.

Brainstorming:

  • Placing 3 UIViews in the UIViewController scene overlaying each other and make one of them "on top" according to the UISegmentControl.

  • Make a long un-scrollable UIScrollView with the content from 1,2,3 and jump up and down in the UIScrollView to given coordinates according to the UISegmentControl

I don't want to get stuck again so please tell me the easiest way of this, I just need some hints..

ingenspor
  • 924
  • 2
  • 15
  • 37

1 Answers1

1

I believe what you are looking for in this case is a container view controller. Here's also an article about them Subjective Objective-C - container view controllers and another SO article relating to them here Container View Controller Examples

Community
  • 1
  • 1
Lbatson
  • 1,017
  • 8
  • 18