Know When Cancel Button is Clicked in Apple Watch

2019-08-10 05:40发布

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.

2条回答
Ridiculous、
2楼-- · 2019-08-10 06:10

If you need to do some things when the controller will be dismissed you can also call deinit e.g. ;

  deinit {
    doStuff()
  }
查看更多
不美不萌又怎样
3楼-- · 2019-08-10 06:16

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.

查看更多
登录 后发表回答