Tencent / QMUI_iOS

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

QMUIModalPresentationWindow没释放 #1525

Open weidongliu opened 1 year ago

weidongliu commented 1 year ago

Bug 表现 QMUIModalPresentationWindow没释放

截图 image

如何重现 使用QMUIAlertController弹窗后关闭

预期的表现 QMUIModalPresentationWindow释放掉

其他信息

RomanticEncounter commented 1 year ago

是不是你在contentViewBlock中引用了QMUIModalPresentationViewController,你可以将QMUIModalPresentationViewController弱引用,例如:

@weakify(modalViewController)
contentView.completeHandler = ^{
    @strongify(modalViewController)
    [modalViewController hideWithAnimated:YES completion:^(BOOL finished) {
        if (finished) {
            completeHandler();
        }
    }];
};
weidongliu commented 1 year ago

@RomanticEncounter 没有噢,我都没主动调用到QMUIModalPresentationViewController,使用方法就是这样 let controller = QMUIAlertController(title: nil, message: message, preferredStyle: .alert) controller.showWith(animated: true)