I have a section in my app where I am changing views by using a UIViewAnimationTransitionFlipFromLeft animation. At the same time, I change the contents of the UINavigationItem to match the new view, specifically the titleView and rightBarButtonItem. Since I only really know when the animation is about to start, and has finished, this seems to be the only times that I can update the UINavigationItem.
So, to my question:
-
Is it possible to change the
titleViewandrightBarButtonItemin a similar fashion, ie. flipping with aUIViewAnimationTransitionFlipFromLeftanimation? -
If not, is there any way that I can update the
UINavigationItemhalfway through the view flip, rather than at the start or end of the animation?
You can solve 1.
You’ll need full control of the navigation bar to do this so you should get rid of the one that’s there using:
on your UIViewController and putting your own navBar view there instead (which would have a subview that’s the titleView and the rightBarButtonItem). That way, you can flip those views as you would any other UIView using:
or
or something equivalent. Hope this helps, ping me if you need more details.