We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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到二级页面时,在二级页面实现 view.hero.id = **** self.isHeroEnabled = true 并且还在二级页面设置UIPanGestureRecognizer侧滑手势,
@objc func slide(pan: UIPanGestureRecognizer) { let translationX = pan.translation(in: pan.view).x if translationX > 0 { // 向右平移滑动 let progress = translationX / (ScreenW / 3) switch pan.state { case .began: dismiss(animated: true) case .changed: Hero.shared.update(progress)
let position = CGPoint(x: translationX + view.center.x, y: pan.translation(in: pan.view).y + view.center.y) Hero.shared.apply(modifiers: [.position(position)], to: view) default: if progress + pan.velocity(in: pan.view).x > 0.5 { Hero.shared.finish() } else { Hero.shared.cancel() } } } }
我以为能够正常侧滑返回一级页面.
最后发现slide方法正常执行,但侧滑功能失效,然后返回一级页面时整个APP就卡死了. 然而不知道为什么模拟器测试是没有任何问题一切正常.
Hero Version:
iOS Version(s): 14.0
Swift Version: 5.4.2
Devices/Simulators: Devices
Reproducible in Examples? (Yes/No): NO
The text was updated successfully, but these errors were encountered:
我也遇到了这个问题,请问你现在解决了没
Sorry, something went wrong.
某些情况下iPhone正常,iPad会崩溃
把 finish cancel 等操加个 DispatchQueue.main.async { } ,可以解决问题
谢谢分享,以后再用遇到试试
我也遇到这个问题了,我是push到次级页面,实现手势下拉返回,有一定几率页面卡死
No branches or pull requests
What did you do?
从一级页面present到二级页面时,在二级页面实现
view.hero.id = ****
self.isHeroEnabled = true 并且还在二级页面设置UIPanGestureRecognizer侧滑手势,
@objc func slide(pan: UIPanGestureRecognizer) {
let translationX = pan.translation(in: pan.view).x
if translationX > 0 {
// 向右平移滑动
let progress = translationX / (ScreenW / 3)
switch pan.state {
case .began:
dismiss(animated: true)
case .changed:
Hero.shared.update(progress)
What did you expect to happen?
我以为能够正常侧滑返回一级页面.
What happened instead?
最后发现slide方法正常执行,但侧滑功能失效,然后返回一级页面时整个APP就卡死了. 然而不知道为什么模拟器测试是没有任何问题一切正常.
General Information
Hero Version:
iOS Version(s): 14.0
Swift Version: 5.4.2
Devices/Simulators: Devices
Reproducible in Examples? (Yes/No): NO
Demo Project
The text was updated successfully, but these errors were encountered: