This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
func viewAnimationOptionForCurve(curve: UIViewAnimationCurve) -> UIViewAnimationOptions { | |
switch (curve) { | |
case .EaseInOut: | |
return UIViewAnimationOptions.CurveEaseInOut | |
case .EaseIn: | |
return UIViewAnimationOptions.CurveEaseIn | |
case .EaseOut: | |
return UIViewAnimationOptions.CurveEaseOut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension NSTimer { | |
class func scheduledTimerWithTimeInterval( | |
timeInterval: NSTimeInterval, userInfo: AnyObject?, repeats: Bool, block: (timer: NSTimer) -> Void) -> NSTimer | |
{ | |
let minion = TimerBlock(block: block) | |
// The `minion` will be retained by the `NSTimer` as its `target`, until the timer is invalidated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// MARK: - Extension | |
extension NSDate: Comparable {} | |
public func <(lhs: NSDate, rhs: NSDate) -> Bool { | |
return lhs.timeIntervalSinceReferenceDate < rhs.timeIntervalSinceReferenceDate | |
} | |
public func <=(lhs: NSDate, rhs: NSDate) -> Bool { |