主屏幕小部件上的iOS时钟动画 [英] iOS clock animations on homescreen widget
问题描述
我想向我的应用程序添加主屏幕小部件,就像iOS系统的Clock应用程序一样,秒针每秒都在移动.我已经在Google和Github上搜索了很长时间,但没有找到合适的解决方案.我已经看到已经有可以实现此类桌面小部件的第三方应用程序.例如: https://apps.apple.com/us/app/id1525347157
I want to add a homescreen widget to my app, just like the iOS system Clock app, the second hand keeps moving every second. I have been searching on Google and Github for a long time and have not found a suitable solution. I have seen that there are already third-party apps that can implement such desktop widgets. For example: https://apps.apple.com/us/app/id1525347157
他们是怎么做到的?
推荐答案
想法是在每个刻度上简单地对 WidgetCenter.shared.reloadAllTimelines()
进行垃圾邮件.检查此仓库: https://github.com/lexrus/LexClockWidget
The idea is to simply spam WidgetCenter.shared.reloadAllTimelines()
every tick. Check this repo: https://github.com/lexrus/LexClockWidget
这篇关于主屏幕小部件上的iOS时钟动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!