了解何时在 Apple Watch 模态界面控制器中单击取消按钮 [英] Know When Cancel Button is Clicked in Apple Watch Modal Interface Controller

查看:22
本文介绍了了解何时在 Apple Watch 模态界面控制器中单击取消按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果界面控制器是模态显示的,有没有办法知道用户是否按下了取消按钮?假设您想在界面控制器关闭之前做一些事情.

Is there a way to know if the cancel button is pressed by the user if the interface controller was displayed modally? Let's say you want to do something before the interface controller is dismissed.

推荐答案

唯一可用的方法是 -didDeactivate.当屏幕消失或应用程序关闭时,这将被调用.不幸的是,无法直接知道何时按下取消按钮.

The only method available is -didDeactivate. This will get called when the screen will disappear or when the app will close. Unfortunately, there is no direct way to know when the cancel button is pressed.

这篇关于了解何时在 Apple Watch 模态界面控制器中单击取消按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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