Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在 Today Extension 中在后台更新数据吗?在某种意义上在屏幕上不可见。或者只有它在方法 widgetPerformUpdateWithCompletionHandler 中显示在屏幕上???谢谢答案!
Today 扩展在后台自动更新。NCWidgetProviding协议方法widgetPerformUpdate处理这个。
NCWidgetProviding
widgetPerformUpdate
func widgetPerformUpdate(completionHandler: @escaping (NCUpdateResult) -> Swift.Void) { completionHandler(NCUpdateResult.newData) }
此方法称为:
更多内容可以参考:https ://github.com/pgpt10/Today-Widget