From 51c08fb064b1b837b784577386ec5ebad2cd60c5 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Tue, 13 Aug 2019 10:02:38 +0800 Subject: [PATCH] update --- ProHUD/Alert/AlertController.swift | 6 ++++-- ProHUD/Toast/ToastController.swift | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ProHUD/Alert/AlertController.swift b/ProHUD/Alert/AlertController.swift index 5534f11..1eedafc 100644 --- a/ProHUD/Alert/AlertController.swift +++ b/ProHUD/Alert/AlertController.swift @@ -148,8 +148,10 @@ public extension Alert { } - func animate(rotate: Bool) { - if rotate { + /// 图片旋转效果 + /// - Parameter flag: 是否开启 + func rotate(_ flag: Bool = true) { + if flag { DispatchQueue.main.async { let ani = CABasicAnimation(keyPath: "transform.rotation.z") ani.toValue = Double.pi * 2.0 diff --git a/ProHUD/Toast/ToastController.swift b/ProHUD/Toast/ToastController.swift index 4c511b1..c283383 100644 --- a/ProHUD/Toast/ToastController.swift +++ b/ProHUD/Toast/ToastController.swift @@ -174,9 +174,9 @@ public extension Toast { } /// 图片旋转效果 - /// - Parameter rotate: 是否开启 - func animate(rotate: Bool) { - if rotate { + /// - Parameter flag: 是否开启 + func rotate(_ flag: Bool = true) { + if flag { DispatchQueue.main.async { let ani = CABasicAnimation(keyPath: "transform.rotation.z") ani.toValue = Double.pi * 2.0