How do I see the progress of a pop animation?

326 Views Asked by At

I have a master and detail view controller. I have a button that currently disappears after the push segue to the detail and reappears when the pop segue is called, whether it's the interactive gesture or the back button.

This looks really abrupt and I wanted to fade in the alpha on the button with the pop gesture but I don't see any delegate or datasource methods for UINavigationControllerDelegate that show the progress of the pop gesture. Are there any libraries that help with this?

1

There are 1 best solutions below

2
On

This can be accomplished with a UIView animation.

The idea is to set the alpha of the button to 0 so that it is invisible and then animate it to a value of 1 to create a fade-in effect.

self.myButton.alpha = 0;

[[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
    self.myButton.alpha = 1;
} completion:^(BOOL finished) {
    // Code for completion of animation.
}];

This could be placed in the viewDidAppear: method of your view controller.