The today widget is drawn correctly when it is added to the today view. But if you user comes back to it later, the viewDidLoad function is not called and it is showing stale data. Should viewDidLoad be called everytime? Is there an iOS 9 / Xcode 7 beta 6 bug?
Edit: Added that widgetPerformUpdateWithCompletionHandler not called either. I have breakpoints set and print functions
func widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)) {
print("in widgetPerformUpdateWithCompletionHandler")
fetch()
completionHandler(NCUpdateResult.NewData)
}
viewDidAppear
is called every time screen is presented,viewDidLoad
is only called when view initially loaded. – BumblebeewidgetPerformUpdateWithCompletionHandler:
see here – FlatwidgetPerformUpdateWithCompletionHandler
used to be called each time the widget was displayed. iOS9 calls this methods far less. But I didn't find any documentation about this change. – Plexus