瀏覽代碼

修改alert样式

harry 3 年之前
父節點
當前提交
51a50e4327
共有 1 個文件被更改,包括 29 次插入13 次删除
  1. 29 13
      Introduce/Record/INVideoExportController.swift

+ 29 - 13
Introduce/Record/INVideoExportController.swift

@@ -659,23 +659,39 @@ class INVideoExportController: BFBaseViewController {
     }
 
     func whetherCancelExport(comfirm: (() -> Void)?) {
-        let remindData = BFBaseModel()
-        remindData.summary = "正在合成中,是否取消?"
-        let alertV = BFRemindView(frame: view.bounds)
-        alertV.isBanned = true
-        alertV.confirmBtn.setTitle("继续合成", for: .normal)
-        alertV.cancelBtn.setTitle("取消合成", for: .normal)
-        alertV.remindData = remindData
-        alertV.remindBlock = { [weak self] item, _ in
+        let alertController = UIAlertController(title: "正在合成中,是否取消?",
+                       message: "", preferredStyle: .alert)
+        let cancelAction = UIAlertAction(title: "继续合成", style: .default, handler: nil)
+        let okAction = UIAlertAction(title: "取消合成", style: .default) {[weak self] action in
             guard let sself = self else {
                 return
             }
-            if item.tag == 1 { // 确定返回到上一层
-                sself.export.cancelExport()
-                comfirm?()
-            }
+            sself.export.cancelExport()
+            comfirm?()
         }
-        UIApplication.shared.keyWindow?.addSubview(alertV)
+        alertController.addAction(okAction)
+        alertController.addAction(cancelAction)
+
+        self.present(alertController, animated: true, completion: nil)
+        
+        
+//        let remindData = BFBaseModel()
+//        remindData.summary = "正在合成中,是否取消?"
+//        let alertV = BFRemindView(frame: view.bounds)
+//        alertV.isBanned = true
+//        alertV.confirmBtn.setTitle("继续合成", for: .normal)
+//        alertV.cancelBtn.setTitle("取消合成", for: .normal)
+//        alertV.remindData = remindData
+//        alertV.remindBlock = { [weak self] item, _ in
+//            guard let sself = self else {
+//                return
+//            }
+//            if item.tag == 1 { // 确定返回到上一层
+//                sself.export.cancelExport()
+//                comfirm?()
+//            }
+//        }
+//        UIApplication.shared.keyWindow?.addSubview(alertV)
     }
 }