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