From e97b863bfafb2fc0fd870abc933276aa96a17a45 Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期五, 17 十一月 2023 21:19:03 +0800 Subject: [PATCH] BUG --- WanPai/Common/View/CommonAlertView.swift | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/WanPai/Common/View/CommonAlertView.swift b/WanPai/Common/View/CommonAlertView.swift index 62efd30..81bf4ca 100644 --- a/WanPai/Common/View/CommonAlertView.swift +++ b/WanPai/Common/View/CommonAlertView.swift @@ -28,11 +28,22 @@ } - static func show(title:String,content:String,isSingle:Bool = false, clouse:@escaping (Bool)->Void){ + static func show(title:String,content:String,cancelStr:String? = nil,completeStr:String? = nil,isSingle:Bool = false, clouse:@escaping (Bool)->Void){ let alertView = CommonAlertView.jq_loadNibView() alertView.label_title.text = title alertView.label_content.text = content alertView.btn_cancel.isHidden = isSingle + + + if cancelStr != nil{ + alertView.btn_cancel.setTitle(cancelStr!, for: .normal) + } + + if completeStr != nil{ + alertView.btn_complete.setTitle(completeStr!, for: .normal) + } + + alertView.clouse = clouse alertView.frame = sceneDelegate?.window?.frame ?? .zero sceneDelegate?.window?.addSubview(alertView) -- Gitblit v1.7.1