From 78e0f94e851eac679b522e28bf32a58f036cd1f8 Mon Sep 17 00:00:00 2001 From: spf-iOS Date: Sun, 10 Sep 2017 20:46:19 +0800 Subject: [PATCH] add image --- MGProgressHUD.podspec | 2 +- .../Classes/MGProgressHUD_extension.swift | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/MGProgressHUD.podspec b/MGProgressHUD.podspec index aa9c04b..f844bc7 100644 --- a/MGProgressHUD.podspec +++ b/MGProgressHUD.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "MGProgressHUD" - s.version = "2.1.12" + s.version = "2.1.13" s.summary = "蘑菇租房正在使用的ProgressHUD。" # This description is used to generate tags and improve search results. diff --git a/MGProgressHUD/Classes/MGProgressHUD_extension.swift b/MGProgressHUD/Classes/MGProgressHUD_extension.swift index bcead26..665cdfc 100644 --- a/MGProgressHUD/Classes/MGProgressHUD_extension.swift +++ b/MGProgressHUD/Classes/MGProgressHUD_extension.swift @@ -9,6 +9,33 @@ import UIKit public extension MGProgressHUD { + @available(*, deprecated:2.1.11, message:"不推荐使用,请使用iconImage:UIImage") + @discardableResult + public class func showView(_ toView:UIView?, + icons:[String]?, + message:String?, + messageColor:UIColor?, + showBgView:Bool?, + detailText:String?, + detailColor:UIColor?, + loationMode:MGLocationMode?) -> MGProgressHUD?{ + + var iconImages: [UIImage]? + if let `icons` = icons { + iconImages = icons.flatMap({ (imageName) -> UIImage? in + return UIImage(named: imageName) + }) + } + + return showView(toView, + iconImages: iconImages, + message: message, + messageColor: messageColor, + showBgView: showBgView, + detailText: detailText, + detailColor: detailColor, + loationMode: loationMode) + } @available(*, deprecated:2.1.11, message:"不推荐使用,请使用iconImage:UIImage") @discardableResult