Created
December 11, 2014 00:16
-
-
Save evgeniyd/35da9cd6bb9114d647f2 to your computer and use it in GitHub Desktop.
In Objective-C, converting from NSNumber to NSTimeInterval is straightforward by Type-Cast from double. Swift, however, needs more strict way, I would say.
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 NSNumber | |
{ | |
var timeIntervalValue: NSTimeInterval { | |
get { | |
return (self.doubleValue as NSTimeInterval) | |
} | |
// TODO: write a setter | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment