Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UINavigationBar custom transition animation

I've created custom transitions between view controllers using the following protocols:

UIViewControllerAnimatedTransitioning and UIViewControllerTransitioningDelegate

Is it possible using the default UINavigationBar, to create custom transitions for the titles, right now they simply crossfade between view controllers, Or do i have to built my own navigation bar view from scratch?

like image 266
Mads Lee Jensen Avatar asked Feb 06 '14 20:02

Mads Lee Jensen


2 Answers

WWDC 2013 video #218 indicates that all custom transitions will crossfade the navigation bar, and that there's no way to customize this behavior.

like image 50
Tim Avatar answered Oct 14 '22 14:10

Tim


If your transition is both custom and interactive, then you can get some mileage out of UIViewControllerTransitionCoordinator.
see Here.

For example, in viewWillAppear of the view controller that is the "To" (target) vc:

[[self transitionCoordinator] animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {

    // mess around with stuff here

} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {

    // all done now
}];
like image 36
xaphod Avatar answered Oct 14 '22 15:10

xaphod