【问题标题】:How pause a timer when app disappear due to call mobile reception? [duplicate]当应用程序因呼叫移动接收而消失时如何暂停计时器? [复制]
【发布时间】:2019-04-17 16:12:25
【问题描述】:

您知道当我的应用因手机接收而停止和消失时,我可以如何暂停(或停止)我的计时器吗?

它是 AppDelegate 中的方法吗?

谢谢

【问题讨论】:

标签: ios swift appdelegate


【解决方案1】:

您可以在NotificationCenter 中订阅willResignActiveNotification 通知,并在发生这种情况时运行代码。你可以阅读它here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-07
    • 1970-01-01
    • 2014-12-07
    • 1970-01-01
    • 2021-07-24
    • 1970-01-01
    相关资源
    最近更新 更多