Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4250070
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:28:48+00:00 2026-05-21T04:28:48+00:00

I have a tabbar -> navigationcontroller structure. In one of these tabs, I want

  • 0

I have a tabbar -> navigationcontroller structure. In one of these tabs, I want to switch between two UIViewControllers (a KalViewController and a UITableViewController to be be exact), using a UISegmentedControl located in the Navigation Bar.

Currently, I have a third UIViewController, that pops and pushes the appropriate ViewControllers on segment value change. I don’t think thats the right way to do it and it also destroys the navigation stack (when I tap on the bar item, the navigation controller goes the root controller, which won’t work). And there’s even another bug, related to the Kal Component.

So, what’s the right way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:28:49+00:00Added an answer on May 21, 2026 at 4:28 am

    The right way to do it is to have the controller handling the UISegmentedControl add the views of the controllers as subviews.

    [self.view addSubview:controller.view];
    

    It’s your responsibility to send viewWillAppear: and so on.

    EDIT: The offset you’re talking about can be adjusted using:

    controller.view.frame = CGRectMake(x, y, width, height);
    

    EDIT 2: In response to tc.’s comment:

    From the documentation of UISplitViewController:

    Message Forwarding to Its Child View Controllers

    A split view controller interposes itself between the application’s window and its child view controllers. As a result, all messages to the visible view controllers must flow through the split view controller. This works generally as you might expect and the flow of messages should be relatively intuitive. For example, view appearance and disappearance messages are sent only when the corresponding child view controller actually appears on screen. Thus, when a split view controller is first displayed in a portrait orientation, it calls the viewWillAppear: and viewDidAppear: methods of only the view controller that is shown initially. The view controller that is presented using a popover does not receive those messages until the popover is shown or until the split view controller rotates to a landscape orientation.

    This is not magical and there is no reason why you wouldn’t be able to write a similar controller yourself. In fact I’ve done it and it worked just fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a navigationController app. I push a tabbar onto the view. Tabs are
I have an tabbar but i want to switch to another view on a
I want to use TabBar and wnat to also have more than one views.
I have a tabbar-based iOS app with two tabs. When I tab into the
I have two tabbar items(views) that use the same data, whats the best solution
I have a tabBar, and I want to customise the items in the tab
I have developed a tabBar application in iphone,it uses 4 tabs to show the
I have following problem: I have built a tabbar application with 4 tabs. I
I have two view controllers in a tabbar which can both edit data. Therefore,
I have view controllers in a tabBar. And the tabBar is in navigationController. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.