Can I update data in Today Extension, while it's in background? In a sense not visibile on screen. Or Only it's showing on the screen in method widgetPerformUpdateWithCompletionHandler??? thx for answers!
Asked
Active
Viewed 577 times
1 Answers
1
Today extension is automatically updated in the background. The NCWidgetProviding
protocol method widgetPerformUpdate
handles this.
func widgetPerformUpdate(completionHandler: @escaping (NCUpdateResult) -> Swift.Void)
{
completionHandler(NCUpdateResult.newData)
}
This method is called:
- When widget is updated in background.
- Before widget snapshot is taken.
For more you can refer to: https://github.com/pgpt10/Today-Widget

PGDev
- 23,751
- 6
- 34
- 88