3

This is my code:

func pullToRefresh() {
    if Reachability().connectionStatus() == .Online {
        self.homewebview.reload()
    } else {
        self.refreshControl.endRefreshing()
        let alert = UIAlertView(title: "No Internet connection", message: "Please check your Internet connection.", delegate: nil, cancelButtonTitle: "Okay")
        alert.show()
    }
}

When internet connection is not available and the user pulls to refresh an alert should be shown and the animation should stop. That works great on iOS 9. But on iOS 10 Beta 2 the animation doesn't disappear. The user have to pull up to make it disappear. It that an iOS 10 bug or am I doing something wrong?

  • This could happen if `pullToRefresh` is not being called on the main thread. Check this by adding `assert(NSThread.isMainThread())` at the top of the function. – Luke Van In Jul 09 '16 at 16:37
  • Okay, I'll try it. But what does it do? What is `assert()` and was is the main thread? –  Jul 09 '16 at 16:54
  • Your suggestion doesn't work. Still the same problem. Any other ideas? –  Jul 09 '16 at 20:50
  • Have you found the solution, since I'm having the same problem? – schmru Sep 30 '16 at 10:47

0 Answers0