From f8e935cc7a8f3002eb59968ec85f0b7815c62797 Mon Sep 17 00:00:00 2001 From: Tomohiro Mitsumune Date: Thu, 17 Mar 2016 18:14:02 +0900 Subject: [PATCH 1/3] Add UIBlurEffectStyle variable ( change style when initialize) --- HUDKit/Classes/Progress/HUDProgressViewController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HUDKit/Classes/Progress/HUDProgressViewController.swift b/HUDKit/Classes/Progress/HUDProgressViewController.swift index 1d54280..c52e040 100644 --- a/HUDKit/Classes/Progress/HUDProgressViewController.swift +++ b/HUDKit/Classes/Progress/HUDProgressViewController.swift @@ -67,13 +67,16 @@ public class HUDProgressViewController: UIViewController { } } + public var visualEffect: UIBlurEffectStyle? + // MARK: - Initializer - public init(customView: UIView?, status: String?) { + public init(customView: UIView?, status: String?, visualEffect: UIBlurEffectStyle = .Dark) { super.init(nibName: "HUDProgressViewController", bundle: NSBundle(forClass: HUDProgressViewController.self)) self.customView = customView self.status = status + self.visualEffect = visualEffect preferredContentSize = CGSizeMake(100.0, 100.0) @@ -111,7 +114,7 @@ extension HUDProgressViewController: UIViewControllerTransitioningDelegate { public func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? { let HUD = HUDPresentationController(presentedViewController: presented, presentingViewController: presenting) - HUD.HUDVisualEffect = UIBlurEffect(style: .Dark) + HUD.HUDVisualEffect = UIBlurEffect(style: self.visualEffect ?? .Dark) return HUD } From 07c7ce7e67c31f4ab9e16b8a5583a3997de76311 Mon Sep 17 00:00:00 2001 From: Tomohiro Mitsumune Date: Thu, 17 Mar 2016 19:57:59 +0900 Subject: [PATCH 2/3] Change parameter type from UIBlurEffectStyle to UIBlurEffect --- HUDKit/Classes/Progress/HUDProgressViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/HUDKit/Classes/Progress/HUDProgressViewController.swift b/HUDKit/Classes/Progress/HUDProgressViewController.swift index 90f5bc3..90d82e9 100644 --- a/HUDKit/Classes/Progress/HUDProgressViewController.swift +++ b/HUDKit/Classes/Progress/HUDProgressViewController.swift @@ -67,16 +67,16 @@ public class HUDProgressViewController: UIViewController { } } - public var visualEffect: UIBlurEffectStyle? + public var blurEffect: UIBlurEffect? // MARK: - Initializer - public init(customView: UIView?, status: String?, visualEffect: UIBlurEffectStyle = .Dark) { + public init(customView: UIView?, status: String?, blurEffect: UIBlurEffect? = nil) { super.init(nibName: "HUDProgressViewController", bundle: NSBundle(forClass: HUDProgressViewController.self)) self.customView = customView self.status = status - self.visualEffect = visualEffect + self.blurEffect = blurEffect ?? UIBlurEffect(style: .Dark) if let customView = customView { let insets = UIEdgeInsets(top: -30, left: -30, bottom: -30, right: -30) @@ -119,7 +119,7 @@ extension HUDProgressViewController: UIViewControllerTransitioningDelegate { public func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? { let HUD = HUDPresentationController(presentedViewController: presented, presentingViewController: presenting) - HUD.HUDVisualEffect = UIBlurEffect(style: self.visualEffect ?? .Dark) + HUD.HUDVisualEffect = self.blurEffect ?? UIBlurEffect(style: .Dark) return HUD } From 7b5cc1a24dcb99a4646762ddce4914b3b717d900 Mon Sep 17 00:00:00 2001 From: Tomohiro Mitsumune Date: Fri, 25 Mar 2016 17:32:09 +0900 Subject: [PATCH 3/3] Change initialize parameter --- Example/Base.lproj/Main.storyboard | 4 ++-- HUDKit/Classes/Progress/HUDProgressViewController.swift | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Example/Base.lproj/Main.storyboard b/Example/Base.lproj/Main.storyboard index bc07810..843346c 100644 --- a/Example/Base.lproj/Main.storyboard +++ b/Example/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + diff --git a/HUDKit/Classes/Progress/HUDProgressViewController.swift b/HUDKit/Classes/Progress/HUDProgressViewController.swift index 90d82e9..4d97b1f 100644 --- a/HUDKit/Classes/Progress/HUDProgressViewController.swift +++ b/HUDKit/Classes/Progress/HUDProgressViewController.swift @@ -67,16 +67,16 @@ public class HUDProgressViewController: UIViewController { } } - public var blurEffect: UIBlurEffect? + public var visualEffect: UIVisualEffect? // MARK: - Initializer - public init(customView: UIView?, status: String?, blurEffect: UIBlurEffect? = nil) { + public init(customView: UIView?, status: String?, visualEffect: UIVisualEffect? = nil) { super.init(nibName: "HUDProgressViewController", bundle: NSBundle(forClass: HUDProgressViewController.self)) self.customView = customView self.status = status - self.blurEffect = blurEffect ?? UIBlurEffect(style: .Dark) + self.visualEffect = visualEffect if let customView = customView { let insets = UIEdgeInsets(top: -30, left: -30, bottom: -30, right: -30) @@ -119,7 +119,7 @@ extension HUDProgressViewController: UIViewControllerTransitioningDelegate { public func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? { let HUD = HUDPresentationController(presentedViewController: presented, presentingViewController: presenting) - HUD.HUDVisualEffect = self.blurEffect ?? UIBlurEffect(style: .Dark) + HUD.HUDVisualEffect = self.visualEffect ?? UIBlurEffect(style: .Dark) return HUD }