UIRefreshControl not calling refresh function only for iPhone 6

440 Views Asked by At

Here is my code for pulldown refresh in viewDidLoad

refreshControl = UIRefreshControl()
refreshControl.tintColor = UIColor.blue
refreshControl.attributedTitle = NSAttributedString(string: "Loading")
refreshControl.addTarget(self, action: #selector(self.refresh), for: UIControlEvents.valueChanged)

if #available(iOS 10.0, *) {
    scrollview.refreshControl = refreshControl
} else {
    scrollview.addSubview(refreshControl)
}

here is my refresh function

func refresh() {
print("Pull down refresh called")
}

That works fine for all the devices except iPhone 6. I have tested with iPhone 6 simulator-iOS 10.3 What will be the issue? And how to resolve that?

0

There are 0 best solutions below