I'm experiencing a kind of flicker with my implementation of UIRefreshControl under iOS 8. Every first time I come to the top of my tableView (meaning when the app has just started) I see the flicker shown in the gif below. This does not happen on any subsequent times I come to the top of the tableView until this view is loaded again, so after I did something in another view of the app or restart it altogether.
This is the code in the viewDidLoad() of my application:
let refreshControl = UIRefreshControl()
override func viewDidLoad() {
super.viewDidLoad()
// Doing this here to prevent the UIRefreshControl sometimes looking messed up when waking the app
self.refreshControl.endRefreshing()
updateData()
refreshControl.backgroundColor = UIColor(hue: 0.58, saturation: 1.0, brightness: 0.43, alpha: 1.0)
refreshControl.tintColor = UIColor.whiteColor()
refreshControl.addTarget(self, action: "updateData", forControlEvents: UIControlEvents.ValueChanged)
tableView.addSubview(refreshControl)
}
The refreshControl is declared outside of the viewDidLoad() function as I want to call the endRefreshing method from within my updateData() function. This seemed like the obvious way of doing that.