Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.07k stars 1.37k forks source link

QMUIModalPresentationViewController 重复执行显示过程 #1296

Open 0x1306a94 opened 2 years ago

0x1306a94 commented 2 years ago

Bug 表现

截图

如何重现

预期的表现

其他信息

xixisplit commented 2 years ago

问题原理分析: QMUIModalPresentationViewController 的显示动画事件是在 viewWillAppear 内的.这就会导致一个问题.如果在进入下级页面之后.下级页面被销毁消失. QMUIModalPresentationViewController 重新显示.就会重新触发 viewWillAppear 方法.重新进入显示动画的逻辑.也就是说.不只是presentViewController 其实pushViewController 也会出现这个问题. 解决方案: 第一种, 在外部重写 showingAnimationhidingAnimation 外部自行通过临时变量实现的需求 第二种,则需要再内部通过临时变量判断 在 showingAnimationWithCompletion 方法中拦截判断当前是否已经执行过一次显示动画

0x1306a94 commented 2 years ago

@xixisplit 当通过showInView时应该由框架内部保证不会被重复执行,比较合理吧?