I have an iOS app build with Xcode and Swift.
When I pull to refresh the activityIndicator spins. When I release the animation/spin will stop immediately but the website only refreshes/reloads after ca. 3/4-1 seconds.
Is there a way to show the animation/spin wheel till the end of refreshing? This is my code:
func pullToRefresh() {
self.homewebview.reload()
self.refreshControl.endRefreshing()
// NSURLCache.sharedURLCache().removeAllCachedResponses()
}
func addRefreshControl() {
refreshControl = UIRefreshControl()
refreshControl.attributedTitle = NSAttributedString(string: "Einen Moment bitte…")
refreshControl.addTarget(self, action: #selector(FirstViewController.pullToRefresh), forControlEvents:.ValueChanged)
self.homewebview.scrollView.addSubview(refreshControl)
refreshControl.tintColor = UIColor.blackColor()
}