Skip to content

Commit

Permalink
Fix style with SwiftLint
Browse files Browse the repository at this point in the history
  • Loading branch information
Piergiuseppe Longo committed Jun 24, 2018
1 parent 91b870a commit 3005edc
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions PKHUD/PKHUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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?

Expand Down
2 changes: 1 addition & 1 deletion PKHUD/PKHUDAssets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 6 additions & 6 deletions PKHUD/PKHUDErrorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions PKHUD/PKHUDSquareBaseView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
8 changes: 4 additions & 4 deletions PKHUD/PKHUDSuccessView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion PKHUD/Window.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}()
Expand Down
2 changes: 1 addition & 1 deletion PKHUDDemoUITests/PKHUDDemoUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 3005edc

Please sign in to comment.