如何知道当dismissModalViewControllerAnimated何时启动,以及何时完成? [英] How to know when dismissModalViewControllerAnimated is initiated and also when it is done?

查看:134
本文介绍了如何知道当dismissModalViewControllerAnimated何时启动,以及何时完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法知道dismissModalViewControllerAnimated何时启动,什么时候完成(例如viewWillAppear和viewDidAppear的习语)?

Is there a way to know when the dismissModalViewControllerAnimated is initiated and when it is completed (such as the idiom for viewWillAppear and viewDidAppear)? Unlike other animations, this one doesn't seem to have a delegate that tells you.

推荐答案

是的,比你想象的更容易

Yes, and easier than you think.

当dismissModalViewControllerAnimated:被调用时,底层视图(即将出现的视图)将收到一个viewWillAppear消息和一个viewDidAppear消息。

When dismissModalViewControllerAnimated: is called, the underlying view (the one about to appear) will receive a viewWillAppear message and a viewDidAppear message.

注意:请确保您的视图控制器正确连接或这些消息丢失。

Caveat: make sure your view controllers are hooked up properly or these messages get lost.

这篇关于如何知道当dismissModalViewControllerAnimated何时启动,以及何时完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆