Skip to content

Instantly share code, notes, and snippets.

@danimal141
Created November 4, 2015 12:11
Show Gist options
  • Save danimal141/c64f7b63cd59fe1072bd to your computer and use it in GitHub Desktop.
Save danimal141/c64f7b63cd59fe1072bd to your computer and use it in GitHub Desktop.
public func <(a: NSDate, b: NSDate) -> Bool {
return a.compare(b) == .OrderedAscending
}
public func >(a: NSDate, b: NSDate) -> Bool {
return a.compare(b) == .OrderedDescending
}
public func ==(a: NSDate, b: NSDate) -> Bool {
return a.compare(b) == .OrderedSame
}
extension NSDate: Comparable { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment