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开发者_StackOverflow中文版 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.
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.
精彩评论