Prefer Large Titles and RefreshControl not working well

后端 未结 11 2149
野性不改
野性不改 2020-12-29 05:09

I am using this tutorial to implement a pull-to-refresh behavior with the RefreshControl. I am using a Navigation Bar. When using normal titles eve

11条回答
  •  执念已碎
    2020-12-29 06:02

    I've faced the same problem. Call refreshControl endRefreshing before calling further API.

    refreshControl.addTarget(controller, action: #selector(refreshData(_:)), for: .valueChanged)
    
    @objc func refreshData(_ refreshControl: UIRefreshControl) {
            refreshControl.endRefreshing()
            self.model.loadAPICall {
                self.tableView.reloadData()
            }
        }
    

提交回复
热议问题