diff --git a/PKHUD/PKHUD.swift b/PKHUD/PKHUD.swift index c960b73..81f696b 100644 --- a/PKHUD/PKHUD.swift +++ b/PKHUD/PKHUD.swift @@ -55,13 +55,13 @@ open class PKHUD: NSObject { public override init () { super.init() - + #if swift(>=4.2) let notificationName = UIApplication.willEnterForegroundNotification #else let notificationName = NSNotification.Name.UIApplicationWillEnterForeground #endif - + NotificationCenter.default.addObserver(self, selector: #selector(PKHUD.willEnterForeground(_:)), name: notificationName, @@ -194,7 +194,7 @@ open class PKHUD: NSObject { // MARK: Timer callbacks @objc internal func performDelayedHide(_ timer: Timer? = nil) { - let userInfo = timer?.userInfo as? [String:AnyObject] + let userInfo = timer?.userInfo as? [String: AnyObject] let key = userInfo?["timerActionKey"] as? String var completion: TimerAction? diff --git a/PKHUD/PKHUDAssets.swift b/PKHUD/PKHUDAssets.swift index f9aa00e..50bfed9 100644 --- a/PKHUD/PKHUDAssets.swift +++ b/PKHUD/PKHUDAssets.swift @@ -19,7 +19,7 @@ open class PKHUDAssets: NSObject { internal class func bundledImage(named name: String) -> UIImage { let bundle = Bundle(for: PKHUDAssets.self) - let image = UIImage(named: name, in:bundle, compatibleWith:nil) + let image = UIImage(named: name, in: bundle, compatibleWith: nil) if let image = image { return image } diff --git a/PKHUD/PKHUDErrorView.swift b/PKHUD/PKHUDErrorView.swift index 1b19915..d53bb05 100644 --- a/PKHUD/PKHUDErrorView.swift +++ b/PKHUD/PKHUDErrorView.swift @@ -24,7 +24,7 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating { path.addLine(to: CGPoint(x: 88.0, y: 44.0)) return path.cgPath }() - + #if swift(>=4.2) dash.lineCap = .round dash.lineJoin = .round @@ -34,7 +34,7 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating { dash.lineJoin = kCALineJoinRound dash.fillMode = kCAFillModeForwards #endif - + dash.fillColor = nil dash.strokeColor = UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0).cgColor dash.lineWidth = 6 @@ -60,25 +60,25 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating { func rotationAnimation(_ angle: CGFloat) -> CABasicAnimation { var animation: CABasicAnimation if #available(iOS 9.0, *) { - let springAnimation = CASpringAnimation(keyPath:"transform.rotation.z") + let springAnimation = CASpringAnimation(keyPath: "transform.rotation.z") springAnimation.damping = 1.5 springAnimation.mass = 0.22 springAnimation.initialVelocity = 0.5 animation = springAnimation } else { - animation = CABasicAnimation(keyPath:"transform.rotation.z") + animation = CABasicAnimation(keyPath: "transform.rotation.z") } animation.fromValue = 0.0 animation.toValue = angle * CGFloat(.pi / 180.0) animation.duration = 1.0 - + #if swift(>=4.2) let timingFunctionName = CAMediaTimingFunctionName.easeInEaseOut #else let timingFunctionName = kCAMediaTimingFunctionEaseInEaseOut #endif - + animation.timingFunction = CAMediaTimingFunction(name: timingFunctionName) return animation } diff --git a/PKHUD/PKHUDSquareBaseView.swift b/PKHUD/PKHUDSquareBaseView.swift index 8dbddbf..af6c2a2 100644 --- a/PKHUD/PKHUDSquareBaseView.swift +++ b/PKHUD/PKHUDSquareBaseView.swift @@ -74,7 +74,7 @@ open class PKHUDSquareBaseView: UIView { let threeQuarterHeight = CGFloat(ceilf(CFloat(viewHeight / 4.0 * 3.0))) titleLabel.frame = CGRect(origin: CGPoint.zero, size: CGSize(width: viewWidth, height: quarterHeight)) - imageView.frame = CGRect(origin: CGPoint(x:0.0, y:quarterHeight), size: CGSize(width: viewWidth, height: halfHeight)) - subtitleLabel.frame = CGRect(origin: CGPoint(x:0.0, y:threeQuarterHeight), size: CGSize(width: viewWidth, height: quarterHeight)) + imageView.frame = CGRect(origin: CGPoint(x: 0.0, y: quarterHeight), size: CGSize(width: viewWidth, height: halfHeight)) + subtitleLabel.frame = CGRect(origin: CGPoint(x: 0.0, y: threeQuarterHeight), size: CGSize(width: viewWidth, height: quarterHeight)) } } diff --git a/PKHUD/PKHUDSuccessView.swift b/PKHUD/PKHUDSuccessView.swift index fdd1a1a..56825ec 100644 --- a/PKHUD/PKHUDSuccessView.swift +++ b/PKHUD/PKHUDSuccessView.swift @@ -21,7 +21,7 @@ open class PKHUDSuccessView: PKHUDSquareBaseView, PKHUDAnimating { let layer = CAShapeLayer() layer.frame = CGRect(x: 3.0, y: 3.0, width: 88.0, height: 56.0) layer.path = checkmarkPath.cgPath - + #if swift(>=4.2) layer.fillMode = .forwards layer.lineCap = .round @@ -31,7 +31,7 @@ open class PKHUDSuccessView: PKHUDSquareBaseView, PKHUDAnimating { layer.lineCap = kCALineCapRound layer.lineJoin = kCALineJoinRound #endif - + layer.fillColor = nil layer.strokeColor = UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0).cgColor layer.lineWidth = 6.0 @@ -51,12 +51,12 @@ open class PKHUDSuccessView: PKHUDSquareBaseView, PKHUDAnimating { } open func startAnimation() { - let checkmarkStrokeAnimation = CAKeyframeAnimation(keyPath:"strokeEnd") + let checkmarkStrokeAnimation = CAKeyframeAnimation(keyPath: "strokeEnd") checkmarkStrokeAnimation.values = [0, 1] checkmarkStrokeAnimation.keyTimes = [0, 1] checkmarkStrokeAnimation.duration = 0.35 - checkmarkShapeLayer.add(checkmarkStrokeAnimation, forKey:"checkmarkStrokeAnim") + checkmarkShapeLayer.add(checkmarkStrokeAnimation, forKey: "checkmarkStrokeAnim") } open func stopAnimation() { diff --git a/PKHUD/Window.swift b/PKHUD/Window.swift index 1baaac1..96e4432 100644 --- a/PKHUD/Window.swift +++ b/PKHUD/Window.swift @@ -77,7 +77,7 @@ internal class ContainerView: UIView { fileprivate let backgroundView: UIView = { let view = UIView() - view.backgroundColor = UIColor(white:0.0, alpha:0.25) + view.backgroundColor = UIColor(white: 0.0, alpha: 0.25) view.alpha = 0.0 return view }() diff --git a/PKHUDDemoUITests/PKHUDDemoUITests.swift b/PKHUDDemoUITests/PKHUDDemoUITests.swift index 464ca01..3867be8 100644 --- a/PKHUDDemoUITests/PKHUDDemoUITests.swift +++ b/PKHUDDemoUITests/PKHUDDemoUITests.swift @@ -61,7 +61,7 @@ class PKHUDUITests: XCTestCase { } func waitForCondition(element: XCUIElement, predicate: NSPredicate, timeout: TimeInterval = 3.5) { - expectation(for: predicate, evaluatedWith: element, handler:nil) + expectation(for: predicate, evaluatedWith: element, handler: nil) waitForExpectations(timeout: timeout, handler: nil) }