iPhone - Detect the end of the animation

后端 未结 4 901
走了就别回头了
走了就别回头了 2021-01-21 05:21

How can I detect the end of the animation of a modal view (when I do a dismiss)? (I\'m talking about MFMailComposeViewController which is not created by myself...)

Thank

4条回答
  •  礼貌的吻别
    2021-01-21 06:14

    I needed to do something after dismissing a modal view, and only when it is sure that the modal view is really gone (been completely dealloc-ed). So viewDidDisappear and its friends in the modal view were too early for me.

    The easiest I found was to just delay my code with a NSTimer. When modal view calls its delegate and the delegate invokes removing the modal view, it also queues up the code to be run when the modal view is gone. The timing was something like 300ms or 400ms. (Is there a way to retrieve the actual timing from somewhere?)

提交回复
热议问题