Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

present出一个模态控制器(非fullScreen),控制器中的tableView下拉刷新总是触发系统的dismiss #1584

Open
jps2782316 opened this issue Jul 3, 2023 · 0 comments
Labels

Comments

@jps2782316
Copy link

描述bug
present出一个模态控制器(非fullScreen),控制器中的tableView下拉刷新总是触发系统的dismiss手势,就算将系统dismiss手势禁掉或者设置self.isModalInPresentation = true,只要tableView滑倒顶部再继续下拉,还是会触发dismiss手势效果,而不是触发tableView的下拉刷新。但是如果用系统的UIRefreshControl,滑到顶部后是可以触发下拉刷新的。(实际测试后是tableView.panGestureRecognizer导致的dismiss效果)

必现/偶发?
必现

怎么样重现这个bug

  1. present出目标制器
let vc = GestureTestViewController()
let navi = UINavigationController(rootViewController: vc)
self.present(navi, animated: true)
  1. 禁掉系统模态控制器的dismiss手势(此时如果页面上没有tableView的话,已经无法下拉dismiss了)
let pv = self.navigationController?.presentationController
let recognizers = pv?.presentedView?.gestureRecognizers
let dismissPan = recognizers?.first(where: { $0 is UIPanGestureRecognizer }) as? UIPanGestureRecognizer
recognizers?.forEach({ $0.isEnabled = false })

3.给tableView添加刷新头

tableView.mj_header = CustomRefreshHeader(refreshingBlock: {[weak self] in
       print("....")
})

4.执行下拉刷新,触发的是dismiss效果,而不是刷新效果

你期望的结果是什么?
希望tableView滑到顶部后,是触发下拉刷新,而不是控制器的dismiss

截图

运行环境

  • iPhone12
  • iOS 15
  • Xcode14.2

额外的
最好能提供出现bug的Demo

@jps2782316 jps2782316 added the bug label Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant