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 7038841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:43:04+00:00 2026-05-28T01:43:04+00:00

I have two UITableViewControllers such that when I click next on the first UITableViewController,

  • 0

I have two UITableViewControllers such that when I click next on the first UITableViewController, the second UITableViewController gets pushed on the navigation stack and animates the transition like normal. I’d like to make it so when I push next, only the views animate, and the navigation bar doesn’t (stays the same). I’ve gotten very close to doing this with the code below:

- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    CATransition *navTransition = [CATransition animation];
    navTransition.duration = .5;
    navTransition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    navTransition.type = kCATransitionPush;
    navTransition.subtype = kCATransitionPush;
    [self.navigationController.navigationBar.layer addAnimation:navTransition forKey:nil];

}

I put this code, and I also make it so the title and buttons on both navigation bars are exactly same in each UITableViewController. It almost works, problem is, the navigation bar blinks when the animation occurs. Is there anyway to get it to not blink, or is there any other good way to prevent the animation of the navbar from occurring (ie disabling the animation on the layer or something)?

UPDATE: Anyone got any other ideas? Still struggling with this.

  • 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-28T01:43:05+00:00Added an answer on May 28, 2026 at 1:43 am

    This is what I came up with. Here is the code for the first viewController in the sequence:

    - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
            if (viewController == self)
            {
                    if (self.isInitialized)
                    {
                            CATransition *navigationBarAnimation = [CATransition animation];
                            navigationBarAnimation.duration = 1.5;
                            navigationBarAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];;
                            navigationBarAnimation.type = kCATransitionFade;
                            navigationBarAnimation.subtype = kCATransitionFade;
                            navigationBarAnimation.removedOnCompletion = YES;
                            [self.navigationController.navigationBar.layer addAnimation:navigationBarAnimation forKey:nil];
                    }
                    else 
                    {
                            self.isInitialized = YES;
                    }
            }
    }
    
    - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
            if (viewController == self)
            {
                    if (self.isInitialized)
                    {
                            [self.navigationController.navigationBar.layer removeAllAnimations];
                    }
            }
    }
    

    Here is the code for the 2nd view controller:

    - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
            if (viewController == self)
            {
                    if (!self.isInitialized)
                    {
                            CATransition *navigationBarAnimation = [CATransition animation];
                            navigationBarAnimation.duration = 1.5;
                            navigationBarAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];;
                            navigationBarAnimation.type = kCATransitionFade;
                            navigationBarAnimation.subtype = kCATransitionFade;
                            navigationBarAnimation.removedOnCompletion = YES;
                            [self.navigationController.navigationBar.layer addAnimation:navigationBarAnimation forKey:nil];
                            self.isInitialized = YES;
                    }
            }
    }
    
    - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
            if (viewController == self)
            {
                    if (self.isInitialized)
                    {
                            [self.navigationController.navigationBar.layer removeAllAnimations];
                    }
            }
    }
    

    You have to use the UINavigationController delegate methods to figure out when the UIViewController is being shown. Then for each UIViewController, need to make a BOOL isInitialized property so it helps you determine when the UIViewController is being pushed on the stack, or when it’s being shown because you pushed back on the next UIViewController.

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

Sidebar

Related Questions

I have a navigation controller that works with two UITableViewControllers. The first UITableViewController shows
I have a UINavigationController with two UITableViewControllers pushed onto its stack. Is there any
I have such error: when I click navigationbar.backItemButton I'm showing UIAlertView with two buttons.
I have a UITableViewController which has two sections. The first section shows a single
I have a UITableViewController with two IBOutlet's to two different UITableViewCell's that were made
I have two UITableViewControllers. I'm pushing to the second one and calling the following
I have two UITableViewControllers (hooked up to a UINavigationController). When I click on a
I have two UITableViewControllers with a fairly simple ui flow. One UITableViewController loads another
I have a UINavigationController with two UITableViewControllers (A and B). A is displayed first
I have 2 classes that inherit UITableViewControllers. And this two table views should use

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.