-1

This question is related to this.

I am using KLHorizontalSelect for showing tab bar with scroll option. I have dragged new 7 View Controller on storyboard. If I select Popular, popular view controller should get displayed.

KLHorizontalSelect

Any idea/ suggestions on how to get this done?

Community
  • 1
  • 1
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276

1 Answers1

1

This is a typical example of view controller containment (where you want one view controller to present other view controllers). Navigation controllers and tab bar controllers are example of built in container controllers. But effective iOS 5, Apple opened up containment for the rest of us.

Please see:

By the way, buried in the View Controller Programming Guide is subtle note about those four containment methods:

  • addChildViewController:
  • removeFromParentViewController
  • willMoveToParentViewController:
  • didMoveToParentViewController:

There are some strange interplay here. I would have thought that we, as application developers, would either just do the add... and/or remove... and that iOS would take care of all of the notifications for us, or that we would have to take care of the will... and did... notifications ourselves. But it's actually half-and-half. So read Adding and Removing a Child very carefully.

Rob
  • 415,655
  • 72
  • 787
  • 1,044