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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:35:34+00:00 2026-05-16T02:35:34+00:00

I have a custom button on a view controller in the navigation controller’s heirarchy,

  • 0

I have a custom button on a view controller in the navigation controller’s heirarchy, that when pressed, pops the visible view controller.

I want to use UIView’s transform property to animate the closing of the view controller. It works, but if I use `popViewControllerAnimated:YES’, the default left slide of the animation is still there, though my custom transform also works.

If I set popViewControllerAnimated:NO it doesn’t animate anything at all.

I also looked into using CATransition which works when I have popViewControllerAnimated set to NO, but there isn’t a “zoom” effect that’s part of the public API, and I don’t want to use the private effect. Custom filters are also not available for iPhone, only OS X.

So I guess my questions are:

1) Is there a way to remove the the left slide in the default transition yet still have a custom animation using transform?

2) Some way to use a custom filter for CATransition?

3) If I use a private API for the zoom effect how likely will Apple toss my app in the rejection bin?

Does anyone have a solution I’m overlooking?

  • 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-16T02:35:35+00:00Added an answer on May 16, 2026 at 2:35 am

    I’ve done something similar to what you describe, i.e. change the default animation for pop and push of view in UINavigationController.

    The idea is to disable the default animation for the object and replace it with your own animation. I’ve created a new category for UINavigationController and used a function similar to the one below.

     - (void) altAnimatePopViewControllerAnimated:(BOOL)animated
     {
    [CATransaction begin];
    
    CATransition *transition;
    transition = [CATransition animation];
    transition.type = kCATransitionPush;          // Use any animation type and subtype you like
    transition.subtype = kCATransitionFromTop;
    transition.duration = 0.3;
    
    CATransition *fadeTrans = [CATransition animation];
    fadeTrans.type = kCATransitionFade;
    fadeTrans.duration = 0.3;
    
    
    [CATransaction setValue:(id)kCFBooleanTrue
                     forKey:kCATransactionDisableActions];
    
    [[[[self.view subviews] objectAtIndex:0] layer] addAnimation:transition forKey:nil];
    [[[[self.view subviews] objectAtIndex:1] layer] addAnimation:fadeTrans forKey:nil];
    
    
    
    [self  popViewControllerAnimated:YES];
    [CATransaction commit];
       }
    

    to use just use the code

       [self.navigationController altAnimatePopViewControllerAnimated:YES];
    

    In order to do a push just create another similar function and reverse the animation.

    It’s not perfect but it works. When you choose different animation types play around with the different subviews composing the navigation bar/controller to get it perfect.

    Took my quite a white to come up with this, so use it wisely 🙂

    ******* EDIT

    Try replacing the push transition with this (Didn’t try it myself):

      CAKeyframeAnimation *scale = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
      scale.duration = duration;
      scale.values = [NSArray arrayWithObjects:[NSNumber numberWithFloat:.5f],
                  [NSNumber numberWithFloat:1.2f],
                  [NSNumber numberWithFloat:.85f],
                  [NSNumber numberWithFloat:1.f],
                  nil];
    

    This will do a pop in, i.e. the view will be bigger before it settles to the right size. Play with the values in the array to control the curve of the animation.

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

Sidebar

Related Questions

I have a root view controller with just a simple navigation button that loads
I have a custom navigation controller so i made my own back button that
I have some animation attached to a custom button in a view controller: -
Check out this jsbin . I have a form with a custom button that
I have a custom ButtonUI class that paints the button. Before drawing the text,
I have a custom control that displays a tryAgain button when the control is
i have a custom cell i want to delete it when a button is
As explained in this question , I have a view controller that needs to
I have a custom UITableViewCell which is part of a navigation controller. The cell
I have two UIViewControllers that are contained in a navigatoin view controller and both

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.