Andrew
Andrew

Reputation: 16051

Make view controller change wait for end of custom animation?

I want to perform a custom animation inside my UIViewController when it appears and disappears. On the disappearing part, I was wondering if I could make it delay for a length of time that would allow me to perform the transition before it disappears? So the UINavigationController runs popViewController and then allows the UIViewController some time to do a custom animation before it happens.

Is this possible?

Upvotes: 0

Views: 123

Answers (1)

Anton
Anton

Reputation: 2847

You can use this solution when you press the back button.

 [UIView animateWithDuration:1.0 animations:^{
            // your custom animation
        } completion:^(BOOL finished) {
            [self.navigationController popViewController];
        }];

Upvotes: 4

Related Questions