eggswift / pull-to-refresh

#Busy Re-Building....# An easy way to use pull to refresh and infinite scrolling in Swift. Pod 'ESPullToRefresh'
MIT License
1.82k stars 252 forks source link

Xcode9 无限自动下拉 #95

Open kou8910 opened 6 years ago

kou8910 commented 6 years ago

自定义下啦刷新时候,返回这个这个页面的时候,再下拉,有时会触发无限下啦刷新,无法停止。 var header: ESRefreshProtocol & ESRefreshAnimatorProtocol var footer: ESRefreshProtocol & ESRefreshAnimatorProtocol header = ESRefreshHeaderAnimator.init(frame: CGRect.zero) footer = ESRefreshFooterAnimator.init(frame: CGRect.zero) self.tableView.es_addPullToRefresh(animator: header) { //下拉 [weak self] in self?.Refresh() } self.tableView.es_addInfiniteScrolling(animator: footer) { //上拉 [weak self] in self?.loadMore() } 这个版本好像与UISearchController不兼容 , func configureSearchController(){ searchController = UISearchController(searchResultsController: nil) searchController.dimsBackgroundDuringPresentation = false //设置默认显示内容 searchController.searchBar.placeholder = "搜索名字、小区、电话" //设置searchBar的代理 searchController.searchBar.delegate=self //设置searchBar自适应大小 searchController.searchBar.sizeToFit() //设置definesPresentationContext为true,我们保证在UISearchController在激活状态下用户push到下一个view controller之后search bar不会仍留在界面上。 searchController.definesPresentationContext = true //将searchBar设置为tableview的头视图 tableView.tableHeaderView = searchController.searchBar } 这样设置的 直接添加到tableView的头,手动下啦,跳转,然后在返回这个页面的时候,会导致UISearchController不显示,偶尔会显示,如果手动的轻微下啦一点tableView就会显示。。, 麻烦大神看看什么问题