widgetPerformUpdateWithCompletionHandler called just once

650 views Asked by At

I am implementing a today extension where I take some time to load the needed information, yet I found widgetPerformUpdateWithCompletionHandler is called just once finding no data and never afterwards to find the updated data; this is the piece of code I use:

func widgetPerformUpdateWithCompletionHandler(
    completionHandler: ((NCUpdateResult) -> Void)!) {
        downloadCloseBuses({(data, error) in
            self.resetContentSize()
            let process:NCUpdateResult=self.busCollection.count()>0 ? .NewData: .NoData
            completionHandler(process)
        })
}
1

There are 1 answers

0
Fabrizio Bartolomucci On BEST ANSWER

I ended up saving the closure and calling it each time new data was available.