Question

I have a normal UINavigationController with a UIViewController contained in it, when my view controller has a prompt applied to it (via a UINavigationItem.prompt = @"some prompt"), the prompt is animating the UIViewController's view downward.

My question is, is there an apple what to find out that a prompt will appear (and maybe the animation time it will take) so I can relayout the view? For example: so the content appears not to move. Or do I have to write this functionality myself. What i am really looking for is a notification similar to the KeyboardWillShow/Hide notifications.

Note that the controller is not the object applying the prompt, and the prompt will appear and disappear asynchronously. Not looking for code, just advice.

Was it helpful?

Solution

You can always use kvo to get a callback whenever the value changes. As for the time taken, it may be just the default (0.25 seconds) or it may use the UINavigationControllerHideShowBarDuration constant. I imagine that you really only need to get it "close enough" when dealing with this animation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top