Skip to content

Commit 85a613c

Browse files
committed
Fixed coding style issues
1 parent 59f29b0 commit 85a613c

File tree

22 files changed

+45
-83
lines changed

22 files changed

+45
-83
lines changed

EZProgressHUD.podspec

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11

22
Pod::Spec.new do |spec|
33

4-
spec.name = "EZProgressHUD"
5-
spec.version = "1.5.3"
6-
spec.summary = "A very cool and easy to use activity indicator for iOS Application ;) Hope you fellas enjoy it 😊😊"
7-
4+
spec.name = "EZProgressHUD"
5+
spec.version = "1.5.4"
6+
spec.summary = "A very cool and easy to use activity indicator for iOS Application ;) Hope you fellas enjoy it 😊😊"
87
spec.description = <<-DESC
9-
As we said, this is a very cool and easy to use activity indicator for iOS and guess what!!?? Android Application(coming soon...)
10-
hope you guys enjoy it. -shndrs -hnk
8+
As we said, this is a very cool and easy to use activity indicator for iOS
9+
hope you guys enjoy it. -shndrs
1110
DESC
1211

13-
spec.homepage = "https://github.com/shndrs/EZProgressHUD"
14-
spec.license = { :type => "MIT", :file => "LICENSE" }
15-
spec.author = { "shndrs" => "[email protected]" }
12+
spec.homepage = "https://github.com/shndrs/EZProgressHUD"
13+
spec.license = { :type => "MIT", :file => "LICENSE" }
14+
spec.author = { "shndrs" => "[email protected]" }
1615

1716
spec.ios.deployment_target = "9.3"
1817
spec.swift_version = "5"
1918

20-
21-
spec.source = { :git => "https://github.com/shndrs/EZProgressHUD.git", :tag => "#{spec.version}" }
19+
spec.source = { :git => "https://github.com/shndrs/EZProgressHUD.git", :tag => "#{spec.version}" }
2220

2321
spec.source_files = "EZProgressHUD/**/*.{h,m,swift}"
2422
spec.exclude_files = "Classes/Exclude"

EZProgressHUD.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@
649649
"@executable_path/Frameworks",
650650
"@loader_path/Frameworks",
651651
);
652+
MARKETING_VERSION = 1.5.4;
652653
PRODUCT_BUNDLE_IDENTIFIER = shndrs.EZProgressHUD;
653654
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
654655
SKIP_INSTALL = YES;
@@ -677,6 +678,7 @@
677678
"@executable_path/Frameworks",
678679
"@loader_path/Frameworks",
679680
);
681+
MARKETING_VERSION = 1.5.4;
680682
PRODUCT_BUNDLE_IDENTIFIER = shndrs.EZProgressHUD;
681683
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
682684
SKIP_INSTALL = YES;

EZProgressHUD/EZAnimations/EZAnimationArgument.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class BaseAnimationArgument {
1717
self.duration = duration
1818
self.option = option
1919
}
20+
2021
}
2122

2223
public final class TransformArguments: BaseAnimationArgument {
@@ -32,6 +33,7 @@ public final class TransformArguments: BaseAnimationArgument {
3233
self.toValue = toValue
3334
super.init(duration: base.duration, option: base.option)
3435
}
36+
3537
}
3638

3739
public final class LineDashPhaseArguments: BaseAnimationArgument {
@@ -46,4 +48,5 @@ public final class LineDashPhaseArguments: BaseAnimationArgument {
4648
self.autoreverse = autoreverse
4749
super.init(duration: base.duration, option: base.option)
4850
}
51+
4952
}

EZProgressHUD/EZAnimations/EZAnimations.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public class EZAnimations {
2929

3030
@discardableResult
3131
public static func transformX() -> CABasicAnimation {
32-
3332
let transformXScaleAnimation = CABasicAnimation(keyPath: EZStrings.transformScaleX.rawValue)
3433
transformXScaleAnimation.fromValue = 1
3534
transformXScaleAnimation.toValue = 1.02
@@ -43,9 +42,7 @@ public class EZAnimations {
4342
public static func rotation(duration: CFTimeInterval,
4443
rotationMode:RotationMode) -> CABasicAnimation {
4544
var rotationAnimation = CABasicAnimation()
46-
4745
switch rotationMode {
48-
4946
case .xRotation:
5047
rotationAnimation = CABasicAnimation(keyPath: EZStrings.transformRotationX.rawValue)
5148
case .yRotation:
@@ -57,7 +54,6 @@ public class EZAnimations {
5754

5855
@discardableResult
5956
public static func opacity() -> CABasicAnimation {
60-
6157
let opacityAnimation = CABasicAnimation(keyPath: EZStrings.opacity.rawValue)
6258
opacityAnimation.fromValue = 1
6359
opacityAnimation.toValue = 0.5
@@ -69,7 +65,6 @@ public class EZAnimations {
6965

7066
@discardableResult
7167
public static func lineWidth(toValue: Any, duration: CFTimeInterval) -> CABasicAnimation {
72-
7368
let lineWidthAnimation = CABasicAnimation(keyPath: EZStrings.lineWidth.rawValue)
7469
lineWidthAnimation.toValue = toValue
7570
lineWidthAnimation.duration = duration
@@ -80,7 +75,6 @@ public class EZAnimations {
8075

8176
@discardableResult
8277
public static func lineDashPhase(with object: LineDashPhaseArguments) -> CABasicAnimation {
83-
8478
let lineDashPhaseAnimation = CABasicAnimation(keyPath: EZStrings.lineDashPhase.rawValue)
8579
lineDashPhaseAnimation.byValue = object.byValue
8680
lineDashPhaseAnimation.duration = object.duration
@@ -94,28 +88,31 @@ public class EZAnimations {
9488
public static func strokeEndAnimation(toValue:Any = 1.0,
9589
duration:CFTimeInterval = 0.75,
9690
option:CAMediaTimingFunctionName = .easeInEaseOut) -> CABasicAnimation {
97-
9891
let strokeEndAnimation = CABasicAnimation(keyPath: EZStrings.strokeEnd.rawValue)
9992
strokeEndAnimation.toValue = 1.0
10093
strokeEndAnimation.duration = 0.75
10194
strokeEndAnimation.timingFunction = CAMediaTimingFunction(name: option)
10295
setCommonAnimationProperties(animation: strokeEndAnimation)
10396
return strokeEndAnimation
10497
}
98+
10599
}
106100

107101
// MARK: - Set common animation properties
108102

109103
extension EZAnimations {
104+
110105
fileprivate class func setCommonAnimationProperties(animation: CABasicAnimation) {
111106
animation.autoreverses = true
112107
animation.repeatCount = .infinity
113108
}
109+
114110
fileprivate class func rotationsCommons(animation: CABasicAnimation, duration: CFTimeInterval) {
115111
animation.fromValue = 0
116112
animation.toValue = CGFloat.pi * 2
117113
animation.duration = duration
118114
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
119115
setCommonAnimationProperties(animation: animation)
120116
}
117+
121118
}

EZProgressHUD/EZBaseView/EZBaseView.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,18 @@ open class EZBaseView: UIView {
6464

6565
/// this method set the circles position, path, fillColor and.........
6666
public func layerGenerator(shapeLayer: CAShapeLayer, type: ShapeLayerType) {
67-
6867
switch type {
69-
7068
case .firstShapeLayer:
7169
shapeLayer.strokeColor = options.firstLayerStrokeColor.cgColor
7270
case .secondShapeLayer:
7371
shapeLayer.strokeColor = options.secondLayerStrokeColor.withAlphaComponent(0.42).cgColor
7472
case .thirdShapeLayer:
7573
shapeLayer.strokeColor = options.thirdLayerStrokeColor.cgColor
7674
}
77-
7875
let circularTrackPath = UIBezierPath(arcCenter: .zero,
7976
radius: options.radius,
8077
startAngle: -(.pi) , endAngle:2 * .pi,
8178
clockwise: true)
82-
8379
shapeLayer.position = transView.center
8480
shapeLayer.path = circularTrackPath.cgPath
8581
shapeLayer.lineWidth = options.strokeWidth
@@ -88,14 +84,12 @@ open class EZBaseView: UIView {
8884
}
8985

9086
public func showBlock() {
91-
9287
UIApplication.shared.keyWindow?.isUserInteractionEnabled = false
9388
UIApplication.shared.keyWindow?.addSubview(transView)
9489
transViewAnimation(completion: nil)
9590
}
9691

9792
public func dismissBlock(completion: (() -> Void)?) {
98-
9993
let completionHandler = { (success:Bool) in
10094
self.transView.removeFromSuperview()
10195
UIApplication.shared.keyWindow?.isUserInteractionEnabled = true
@@ -109,10 +103,9 @@ open class EZBaseView: UIView {
109103
UIView.animate(withDuration: 0.2, delay: 0.0,
110104
options: .curveEaseInOut,
111105
animations: { [weak self] in
112-
113106
guard let self = self else { return }
114-
115107
(self.transView.alpha != 0) ? (self.transView.alpha = 0) : (self.transView.alpha = 1)
116108
}, completion: completion)
117109
}
110+
118111
}

EZProgressHUD/EZFactory/EZFactory.swift

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,15 @@ public struct EZProgressHUD {
1616

1717
@discardableResult
1818
public static func setProgress(with options:EZProgressOptions) -> EZProgress {
19-
2019
switch options.animationOption {
21-
2220
case .heartBeat:
23-
2421
return HeartBeat(options: options)
25-
2622
case .lineLayer:
27-
2823
return LineLayer(options: options)
29-
3024
case .lordOfTheRings:
31-
3225
return LordOfTheRings(options: options)
33-
3426
case .antColony:
35-
3627
return AntColony(options: options)
37-
3828
default:
3929
return rotationBasedProgress(with: options)
4030
}
@@ -43,27 +33,19 @@ public struct EZProgressHUD {
4333
@discardableResult
4434
private static func rotationBasedProgress(with options:EZProgressOptions)
4535
-> EZProgress {
46-
4736
switch options.animationOption {
4837
case .xRotation:
49-
5038
return XRotation(options: options)
51-
5239
case .xyRotation:
53-
5440
return XYRotation(options: options)
55-
5641
case .yRotation:
57-
5842
return YRotation(options: options)
59-
6043
case .hnk:
61-
6244
return HNK(options: options)
63-
6445
default:
6546
return HeartBeat(options: options)
6647
}
6748
}
49+
6850
}
6951

EZProgressHUD/EZOthers/EZStrings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ public enum EZStrings:String {
3030
case hsKey7
3131
case hsKey8
3232
case hsKey9
33+
3334
}
34-

EZProgressHUD/EZProgressOptions/EZProgressOptions.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class EZTitleOptions {
3333

3434
/// color of title text (by default is white)
3535
public var titleTextColor: UIColor = .white
36+
3637
}
3738

3839
@requires_stored_property_inits
@@ -51,6 +52,7 @@ public class EZProgressColorOptions: EZTitleOptions {
5152

5253
/// the background transparent view color (by default is black)
5354
public var transViewBackgroundColor: UIColor = UIColor.black
55+
5456
}
5557

5658
@requires_stored_property_inits
@@ -73,5 +75,5 @@ public class EZProgressOptions: EZProgressColorOptions {
7375
super.init()
7476
options(self)
7577
}
78+
7679
}
77-

EZProgressHUD/EZProgresses/AntColony.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ final public class AntColony: EZBaseProgresses {
1717
titleAnimations()
1818
lineDashAnimation()
1919
}
20+
2021
}
2122

2223
// MARK: - Methods

0 commit comments

Comments
 (0)