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

  • SEARCH
  • Home
  • 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 6024015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:05:35+00:00 2026-05-23T04:05:35+00:00

So I have 2 tabs in my tab bar controller. I have a button

  • 0

So I have 2 tabs in my tab bar controller.

I have a button in Tab 2, and if I click that, control needs to be passed to Tab 1, and it should become the present view controller.

//I should not use navigation for this because the view would navigate
the present view to the view in tab 1 ; but the tab will still indicate Tab 2//

I just need it to go to tab 1 when I click the button.

  • 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-23T04:05:35+00:00Added an answer on May 23, 2026 at 4:05 am

    When you click the button, just have it send the following

    self.tabBarController.selectedIndex = 0;
    

    That will tell it to switch to the first tab in its index (Tab 1)

    If you want to add animation to the change, you’ll use transitionFromView:toView:duration:options:completion:. And to implement this, you’ll use something like this:

    [UIView transitionFromView:self.view 
        toView:[[self.tabBarController.viewControllers objectAtIndex:0] view] 
        duration:1 /*or whatever time you want*/ 
        options:/*specify your animation transition here, they are found in the UIView documentation*/ 
        completion:(void (^)(BOOL finished))completion:^(BOOL finished) {
            if (finished) {
                tabBarController.selectedIndex = 0;
            }
        }];
    

    The options give you control how it transitions, and there’s a nice list of all the stuff you can do. Then the completion block lets you specify what to do once you’re finished. In this case, it will switch to tab 1 so it is the new primary controller

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

Sidebar

Related Questions

I have a tab bar controller with two tabs: tabBar1View with a button named
Here's the setup: I have a tab bar controller with two tabs. There is
So I have 2 tabs in tab bar controller. tab 1 is the rootController.
I have a tab bar controller with 3 tabs. In one of the tabs,
I have a tab bar controller with 6 tabs. The 6th tab I want
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab
I have a tab bar iPhone application with 4 tabs. In the Interface Builder
I have three tabs. When I press the tab button on the bottom, is
I have an application set up where the window contains a tab bar controller
I am developing a tab bar application. I have five tabs in it. For

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.