Tencent / QMUI_iOS

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

QMUIAlertController在swift 5.0版本设置 没有响应弹出的问题 #1038

Closed aitadeta1314 closed 4 years ago

aitadeta1314 commented 4 years ago
            let leftAction = QMUIAlertAction(title: "取消", style: .cancel, handler: nil)

            let rightAction = QMUIAlertAction(title: "保存", style: .default, handler: nil)

            let alertController = QMUIAlertController(title: "是否保存已更改的内容", message: nil, preferredStyle: .actionSheet)
           // alertController.alertCancelButtonAttributes = [NSAttributedString.Key.font: setRegularFont(size: 16), 
           NSAttributedString.Key.foregroundColor: UIColor.skyBlueColor]
           //  alertController.alertButtonAttributes = [NSAttributedString.Key.font: setSpecifiedFont(size: 16), 
           NSAttributedString.Key.foregroundColor: UIColor.skyBlueColor]
            alertController.addAction(leftAction)
            alertController.addAction(rightAction)
            alertController.showWith(animated: true)
aitadeta1314 commented 4 years ago

问题已解决,因为创建项目中没有删除sceneDelegate.swift文件,导致获取不到window;应该是库没有适配iOS13导致。请知悉