0

When I open notification center and the todayWidget of my app is listed down and not appears on the screen, then I scroll down to it, but then the TodayWidget not loaded. It looks like the TodayWidget is frozen... But when it listed up and if it appears immediately on the screen, then it's loaded good... Any idea why is that behaviour??

Same thing is whit situation, when is listed up and i scroll down and then back scroll up on my widget. Then it looks again frozen, the button didn't go squeeze...

Other widget from others app when i scroll on it, it is reload. I didn't find a method for this behaviour... Don't you have any idea where is a problem? Thanks for any advice

my code:

    func widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)) {

    self.refreshIndicator.startAnimating()
    // some code
    self.preferredContentSize.height = CGFloat(self.stationLabel.frame.height + 9)
    locationManager.requestLocation()
    self.initStationName()

    completionHandler(NCUpdateResult.NewData)
}
  • `requestLocation()` does not indicate new data. You need to implement the delegate methods of the location manager to get the information asynchronously and to save the reference to the completion handler. In the delegate method call the completion handler. – vadian Apr 16 '16 at 14:58
  • but initStationName() does indicate new data, so? – Michal Kovi Apr 16 '16 at 15:44
  • I have no idea what `initStationName()` is, but the location functionality works asynchronously. – vadian Apr 16 '16 at 15:53
  • I said, that the `initStationName()` indicates new data, but due to the location functionality works asynchronously it is frozen?? – Michal Kovi Apr 16 '16 at 16:17
  • I guess. If the `station name` depends on the location data, it won't work, – vadian Apr 16 '16 at 16:20

0 Answers0