Skip to content

Commit

Permalink
Fix some castings of .pi
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentiuUngur committed Mar 28, 2017
1 parent 8fef55f commit 64749af
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
54 changes: 27 additions & 27 deletions PKHUD/PKHUDAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@ public final class PKHUDAnimation {
public static let discreteRotation: CAAnimation = {
let animation = CAKeyframeAnimation(keyPath: "transform.rotation.z")
animation.values = [
NSNumber(value: 0.0 as Float),
NSNumber(value: 1.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 2.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 3.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 4.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 5.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 6.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 7.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 8.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 9.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 10.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 11.0 * Float(Double.pi) / 6.0 as Float),
NSNumber(value: 2.0 * Float(Double.pi) as Float)
NSNumber(value: 0.0),
NSNumber(value: 1.0 * .pi / 6.0),
NSNumber(value: 2.0 * .pi / 6.0),
NSNumber(value: 3.0 * .pi / 6.0),
NSNumber(value: 4.0 * .pi / 6.0),
NSNumber(value: 5.0 * .pi / 6.0),
NSNumber(value: 6.0 * .pi / 6.0),
NSNumber(value: 7.0 * .pi / 6.0),
NSNumber(value: 8.0 * .pi / 6.0),
NSNumber(value: 9.0 * .pi / 6.0),
NSNumber(value: 10.0 * .pi / 6.0),
NSNumber(value: 11.0 * .pi / 6.0),
NSNumber(value: 2.0 * .pi)
]
animation.keyTimes = [
NSNumber(value: 0.0 as Float),
NSNumber(value: 1.0 / 12.0 as Float),
NSNumber(value: 2.0 / 12.0 as Float),
NSNumber(value: 3.0 / 12.0 as Float),
NSNumber(value: 4.0 / 12.0 as Float),
NSNumber(value: 5.0 / 12.0 as Float),
NSNumber(value: 0.5 as Float),
NSNumber(value: 7.0 / 12.0 as Float),
NSNumber(value: 8.0 / 12.0 as Float),
NSNumber(value: 9.0 / 12.0 as Float),
NSNumber(value: 10.0 / 12.0 as Float),
NSNumber(value: 11.0 / 12.0 as Float),
NSNumber(value: 1.0 as Float)
NSNumber(value: 0.0),
NSNumber(value: 1.0 / 12.0),
NSNumber(value: 2.0 / 12.0),
NSNumber(value: 3.0 / 12.0),
NSNumber(value: 4.0 / 12.0),
NSNumber(value: 5.0 / 12.0),
NSNumber(value: 0.5),
NSNumber(value: 7.0 / 12.0),
NSNumber(value: 8.0 / 12.0),
NSNumber(value: 9.0 / 12.0),
NSNumber(value: 10.0 / 12.0),
NSNumber(value: 11.0 / 12.0),
NSNumber(value: 1.0)
]
animation.duration = 1.2
animation.calculationMode = "discrete"
Expand All @@ -53,7 +53,7 @@ public final class PKHUDAnimation {
static let continuousRotation: CAAnimation = {
let animation = CABasicAnimation(keyPath: "transform.rotation.z")
animation.fromValue = 0
animation.toValue = 2.0 * Double.pi
animation.toValue = 2.0 * .pi
animation.duration = 1.2
animation.repeatCount = Float(INT_MAX)
return animation
Expand Down
6 changes: 3 additions & 3 deletions PKHUD/PKHUDErrorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating {
}

animation.fromValue = 0.0
animation.toValue = angle * CGFloat(Double.pi / 180.0)
animation.toValue = angle * CGFloat(.pi / 180.0)
animation.duration = 1.0
animation.timingFunction = CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseInEaseOut)
return animation
Expand All @@ -72,8 +72,8 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating {
let dashOneAnimation = rotationAnimation(-45.0)
let dashTwoAnimation = rotationAnimation(45.0)

dashOneLayer.transform = CATransform3DMakeRotation(-45 * CGFloat(Double.pi/180), 0.0, 0.0, 1.0)
dashTwoLayer.transform = CATransform3DMakeRotation(45 * CGFloat(Double.pi/180), 0.0, 0.0, 1.0)
dashOneLayer.transform = CATransform3DMakeRotation(-45 * CGFloat(.pi / 180.0), 0.0, 0.0, 1.0)
dashTwoLayer.transform = CATransform3DMakeRotation(45 * CGFloat(.pi / 180.0), 0.0, 0.0, 1.0)

dashOneLayer.add(dashOneAnimation, forKey: "dashOneAnimation")
dashTwoLayer.add(dashTwoAnimation, forKey: "dashTwoAnimation")
Expand Down

1 comment on commit 64749af

@Piyush08
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
I think this seems not available for cocoapods.Can you please update for the same?

Thank you,

Please sign in to comment.