Skip to content

Commit

Permalink
Merge pull request #32 from noisyscanner/master
Browse files Browse the repository at this point in the history
Fixes warnings in Xcode relating to M_PI
  • Loading branch information
jesster2k10 authored May 6, 2017
2 parents 79b7531 + bb150f4 commit 49dd809
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 4 additions & 3 deletions SubmitTransition/Classes/SpinerLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ class SpinerLayer: CAShapeLayer {

let radius:CGFloat = (frame.height / 2) * 0.5
self.frame = CGRect(x: 0, y: 0, width: frame.height, height: frame.height)

let center = CGPoint(x: frame.height / 2, y: bounds.center.y)
let startAngle = 0 - M_PI_2
let endAngle = M_PI * 2 - M_PI_2
let startAngle = 0 - (Double.pi / 2)
let endAngle = Double.pi * 2 - (Double.pi / 2)
let clockwise: Bool = true
self.path = UIBezierPath(arcCenter: center, radius: radius, startAngle: CGFloat(startAngle), endAngle: CGFloat(endAngle), clockwise: clockwise).cgPath

Expand All @@ -36,7 +37,7 @@ class SpinerLayer: CAShapeLayer {
self.isHidden = false
let rotate = CABasicAnimation(keyPath: "transform.rotation.z")
rotate.fromValue = 0
rotate.toValue = M_PI * 2
rotate.toValue = Double.pi * 2
rotate.duration = 0.4
rotate.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)

Expand Down
15 changes: 15 additions & 0 deletions SubmitTransition/Classes/TimerEx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,19 @@ extension Timer {
CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, .commonModes)
return timer
}


/*class func schedule(delay delay: NSTimeInterval, handler: NSTimer! -> Void) -> NSTimer {
let fireDate = delay + CFAbsoluteTimeGetCurrent()
let timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, fireDate, 0, 0, 0, handler)
CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes)
return timer
}

class func schedule(repeatInterval interval: NSTimeInterval, handler: NSTimer! -> Void) -> NSTimer {
let fireDate = interval + CFAbsoluteTimeGetCurrent()
let timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, fireDate, interval, 0, 0, handler)
CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes)
return timer
}*/
}
1 change: 0 additions & 1 deletion SubmitTransition/Classes/TransitionSubmitButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ open class TKTransitionSubmitButton : UIButton, UIViewControllerTransitioningDel
}, completion: { (done) -> Void in
self.shrink()
Timer.schedule(delay: self.shrinkDuration - 0.25) { timer in

self.spiner.animation()
}
})
Expand Down

0 comments on commit 49dd809

Please sign in to comment.