[英]UIRefreshControl not doing action
So I have enabled refreshing for the table view in Storyboard and put this code into the viewDidLoad() : 因此,我在Storyboard中启用了表视图的刷新,并将此代码放入viewDidLoad()中:
refreshControl?.addTarget(self, action: #selector(ViewController.refresh(sender:)), for: .valueChanged)
and this is the refresh function: 这是刷新功能:
func refresh(sender: AnyObject) {
print("a")
self.tableView.reloadData()
refreshControl?.endRefreshing()
}
The problem is that when I pull to refresh, it does not print "a"(put this for testing) and it does not end refreshing. 问题是,当我拉动刷新时,它不会打印“ a”(将此用于测试)并且不会结束刷新。 Why? 为什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.