Skip to content

Commit

Permalink
Add UIBlurEffectStyle variable ( change style when initialize)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomohiro Mitsumune committed Mar 17, 2016
1 parent a7d42fe commit f8e935c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions HUDKit/Classes/Progress/HUDProgressViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit f8e935c

Please sign in to comment.