我想使用 WkInterfaceTimer 进行倒计时。 从 NSTiemer 开始,我想获取倒计时时发生的事件。
WkInterfaceTimer没有这样的Delegate,怎么办?
最佳答案
WKInterfaceTimer 的文档解释得很好:
A WKInterfaceTimer object is a special type of label that displays a countdown or count-up timer. ... To know when the timer reaches 0, configure an NSTimer object with the same target date you used to set up the timer.
基本上,在 watch 上使用 NSTimer 的方式与在 iOS 应用程序中使用的方式相同,只需使用 WKInterfaceTimer 作为在 watch 屏幕上显示倒计时的方式即可。
关于swift - 如何获取WKInterfaceTimer计数事件的句柄?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40033263/