0

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)
        })
}
Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75

1 Answers1

0

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

Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75