From f33102e5645d838d2d62a526ee6fed963e2676b9 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Tue, 13 Aug 2019 14:42:08 +0800 Subject: [PATCH] update --- ProHUD/Alert/AlertController.swift | 3 +-- ProHUD/Alert/AlertModel.swift | 8 +++--- .../ProHUDMinimize.imageset/Contents.json | 25 ------------------ .../ProHUDMinimize@2x.png | Bin 1057 -> 0 bytes .../ProHUDMinimize@3x.png | Bin 1648 -> 0 bytes .../ProHUDTrash.imageset/Contents.json | 22 --------------- .../ProHUDTrash.imageset/ProHUDTrash@2x.png | Bin 2312 -> 0 bytes .../ProHUDTrash.imageset/ProHUDTrash@3x.png | Bin 3145 -> 0 bytes ProHUD/Toast/ToastModel.swift | 6 ++++- 9 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/Contents.json delete mode 100644 ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/ProHUDMinimize@2x.png delete mode 100644 ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/ProHUDMinimize@3x.png delete mode 100644 ProHUD/ProHUD.xcassets/ProHUDTrash.imageset/Contents.json delete mode 100644 ProHUD/ProHUD.xcassets/ProHUDTrash.imageset/ProHUDTrash@2x.png delete mode 100644 ProHUD/ProHUD.xcassets/ProHUDTrash.imageset/ProHUDTrash@3x.png diff --git a/ProHUD/Alert/AlertController.swift b/ProHUD/Alert/AlertController.swift index 37f771b..5202b6c 100644 --- a/ProHUD/Alert/AlertController.swift +++ b/ProHUD/Alert/AlertController.swift @@ -63,13 +63,12 @@ public extension ProHUD { /// - Parameter title: 标题 /// - Parameter message: 内容 /// - Parameter icon: 图标 - public convenience init(scene: Scene = .default, title: String? = nil, message: String? = nil, icon: UIImage? = nil, actions: ((Alert) -> Void)? = nil) { + public convenience init(scene: Scene = .default, title: String? = nil, message: String? = nil, actions: ((Alert) -> Void)? = nil) { self.init() vm.vc = self vm.scene = scene vm.title = title vm.message = message - vm.icon = icon actions?(self) } diff --git a/ProHUD/Alert/AlertModel.swift b/ProHUD/Alert/AlertModel.swift index 172c52b..9c5d679 100644 --- a/ProHUD/Alert/AlertModel.swift +++ b/ProHUD/Alert/AlertModel.swift @@ -59,7 +59,11 @@ public extension Alert { durationBlock?.cancel() if let t = duration ?? scene.alertDuration, t > 0 { durationBlock = DispatchWorkItem(block: { [weak self] in - self?.vc?.pop() + if let vc = self?.vc { + if vc.buttonEvents.count == 0 { + vc.pop() + } + } }) DispatchQueue.main.asyncAfter(deadline: .now()+t, execute: durationBlock!) } else { @@ -78,7 +82,6 @@ public extension Alert.ViewModel { /// - Parameter text: 标题 /// - Parameter handler: 事件处理 @discardableResult func add(action style: UIAlertAction.Style, title: String?, handler: (() -> Void)?) -> UIButton { - duration = 0 return vc!.insert(action: nil, style: style, title: title, handler: handler) } @@ -88,7 +91,6 @@ public extension Alert.ViewModel { /// - Parameter title: 标题 /// - Parameter handler: 事件处理 @discardableResult func insert(action index: Int, style: UIAlertAction.Style, title: String?, handler: (() -> Void)?) -> UIButton { - duration = 0 return vc!.insert(action: index, style: style, title: title, handler: handler) } diff --git a/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/Contents.json b/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/Contents.json deleted file mode 100644 index 68e7e4c..0000000 --- a/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/Contents.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "ProHUDMinimize@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "ProHUDMinimize@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - }, - "properties" : { - "template-rendering-intent" : "original" - } -} \ No newline at end of file diff --git a/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/ProHUDMinimize@2x.png b/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/ProHUDMinimize@2x.png deleted file mode 100644 index 4ee0a9820583274e7ad79fab11b76c5edac61e6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1057 zcmV++1m63JP)73oJ=oMXg#$Eh1?X znX6AgJ znLGEK(UUboDRlrtJ0R_lW=l|%NlQji9`QVHoQjG9q?#aukav*(1;=n~Q|cr!X+5M5 zG6z{NI7c6(J{6*vs1q^`NgJHA^Is&rl{#QBbvGe>kXS!e{3GheYf&>VM1Fl1we($N zdDfqgT_W4|iPv~iyq(9y%Wd{`?yo|105XU@%5n@b!|VZaTk#l%bg^zjEzL^t z(|u9X&qWFgwrb^azD~S7rzE%kB8WF6^?QWI3m~}|RmKPgo_mOn4mnj^2C)aCzCcy{ z9i6AVdTxt&d%HpOJUm(x9Yd1cQBNij0jD4+bx$V6Hr_h5}pbt-WF0FoB-9Z(r(H3o5AeYOmnmB=207Hic*I45?dG@#O~~YqO@$n%TAVP|@X0-MwW}qpSE8V!aChQKdXNN5 zK$u=N#BFPWqc$Pt5YpdLm}zJB#RMm7&}Jm_ z8zVP*ka+4p{9k5Yf&?csz?Qb@8q}N&!Mo7u5Sx9N8Z!IJ3bYkTN6Cep{CE(q{D$%n z8w{8l3bLt+dTmnZPM&P zU4er6sGB$=Z)Iwj>T)x2XS(U;#N;p#aL|1C6XwOH1z|SZHty92iGn19wPA>JKcjWk zzC0ocBJgC@uitz&tNem!RWC4Cp;l6X&P()LkjyU8V{frdXtgp(GU2cI bzajnt5!Fs1i<5@K00000NkvXXu0mjfZ1?k| diff --git a/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/ProHUDMinimize@3x.png b/ProHUD/ProHUD.xcassets/ProHUDMinimize.imageset/ProHUDMinimize@3x.png deleted file mode 100644 index 0086dda7c978e44bd813ef6a3a6d09ba926e8823..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1648 zcmV-$29NoPP)Si~92@r4XA0L@Ww|8)-Mu zjc$cX7NTzaSybG(s~g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R;jlQ-z;NpNQQH$FSoZvGP(je~Wi6m@XL&WDBq_D1J-B+mskq!rWkW$U_dqEoF1C)|n6 z6_JhCyP=Hif5bodMN8*{&94+iPR_ywC8j(L6LLYGY=drBJh-@b*gmXO_s0uX)SEn#A>grOrlSd70dU%vU$H#yqO8 zW)E?%(iHp5LX8Uoqx_1x>Kraq4{(I#yq!tR0W?F<&2zxfSgu&1KfE=1H7s>=)xHlf z-75jz!7nPWg+N#PPB!-kh}%|YT7+L8UatCN0{wGs?q;JiW|EFCB!3)}BG!L5A| zktyzcc|t@cm9pc-n??7uOA-b~&nujd-<4_3ZWRW)@5a4qbO~C%K{z+{B1Ww*Trpu> zBe+3_POi45w~fb}|8OOgb-p>?gt^ipY=!6>O=BV`S&F6~Nnl}4q!E7#P+f-SV5kFK zPuwEK-|asyZVSSwC{(`9p@Fjip85@q1TMdfskbx{ne>V=)_MZqy-17FTp!BnrAIH4 zo$IRzh_#6Z(e=b4s0=DBBZ7iR4w1S_fbeM{PhvHTPuY?=RL<6a@6y;d4TA> zd1?Vjb-b(c?2~;vE#35_9qd2ygr?Wp?7E}^{So1ip|IIThzP=z?XPS3isgIWsVyhEc(MqoIN|LIE!XY0lWPa}bhwBz6N3?lmX_G*qX?}~e#G1yWMEN<8a zPoCa;$4h-q|LSA#ivbwF@3hMm%@ZR^5u(QiP3B|edzLhzhQSavh%LhAVoTB!FOq(9 Yi;3W&SeEnH--iRRG`nH?#>6AxKb~7)jQ{`u diff --git a/ProHUD/ProHUD.xcassets/ProHUDTrash.imageset/ProHUDTrash@3x.png b/ProHUD/ProHUD.xcassets/ProHUDTrash.imageset/ProHUDTrash@3x.png deleted file mode 100644 index d3f1ccedd46e3b14766765c44516aa95d8a105a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3145 zcmeHK_dgVl8^6Jk?TnHcDRc;*tTWCgnU~Tbab)D2Q8dm@j%*^M&>)<>*P+gc92K&< z&KW1^D zc)B^Q6#!rp^D{BAzh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5jH3?{uap<5#TbKlrdp5lf_rvW54 zy*;=V#3vnV_o>y5=CEfGbgW#GV=;MdX)Yvoa|h#bRJ*o<84Od!@#D_2%=bisHf9Ry spP6lS_e4eSNYTN29h+Ec+^nII_$!@HF3F>RUIc)ZnXPHH@r~I30J!S;4gdfE diff --git a/ProHUD/Toast/ToastModel.swift b/ProHUD/Toast/ToastModel.swift index 85c9f59..ebfd3da 100644 --- a/ProHUD/Toast/ToastModel.swift +++ b/ProHUD/Toast/ToastModel.swift @@ -56,7 +56,11 @@ public extension Toast { durationBlock?.cancel() if let t = duration ?? scene.toastDuration, t > 0 { durationBlock = DispatchWorkItem(block: { [weak self] in - self?.vc?.pop() + if let vc = self?.vc { + if vc.buttonEvents.count == 0 { + vc.pop() + } + } }) DispatchQueue.main.asyncAfter(deadline: .now()+t, execute: durationBlock!) } else {