无故事王国
2024-07-02 655a0215e597e3c46834d9d8a609bab729a1816f
DolphinEnglishLearnStudent/Other/UIView/CommonAlertView.swift
@@ -55,6 +55,7 @@
                        commonAlertView.label_content.numberOfLines = 0
                        commonAlertView.label_content.textAlignment = .center
                        commonAlertView.cancelClouse = cancelClouse
                        commonAlertView.btn_close.setTitle(completeTitle, for: .normal)
                        commonAlertView.frame = sceneDelegate?.window?.frame ?? .zero
                        commonAlertView.btn_complete.isHidden = true
@@ -70,6 +71,27 @@
                        }
            }
            static func show(content:String,completeTitle:String? = nil,completeClouse:@escaping()->Void,cancelClouse:@escaping (()->Void)){
                        let commonAlertView = CommonAlertView.jq_loadNibView()
                        sceneDelegate?.window?.addSubview(commonAlertView)
                        commonAlertView.label_content.text = content
                        commonAlertView.label_content.numberOfLines = 0
                        commonAlertView.label_content.textAlignment = .center
                        commonAlertView.cancelClouse = cancelClouse
                        commonAlertView.btn_complete.setTitle(completeTitle, for: .normal)
                        commonAlertView.frame = sceneDelegate?.window?.frame ?? .zero
                        commonAlertView.clouse = completeClouse
                        UIView.animate(withDuration: 0.4) {
                                    commonAlertView.alpha = 1
                                    commonAlertView.view_container.transform = .init(translationX: 1.0, y: 1.0)
                                    commonAlertView.layoutIfNeeded()
                        }
            }
            @IBAction func closeAction(_ sender: UIButton) {
                        UIView.animate(withDuration: 0.4) {
                                    self.alpha = 0