Skip to content

Instantly share code, notes, and snippets.

@billibala
Created May 22, 2018 04:07
Show Gist options
  • Save billibala/1bc1ae402966b74b875ca2cff3b74b04 to your computer and use it in GitHub Desktop.
Save billibala/1bc1ae402966b74b875ca2cff3b74b04 to your computer and use it in GitHub Desktop.
Demonstrates run time error when the bounds of a date range is not in ascending order
//: Playground - noun: a place where people can play
import Cocoa
let now = Date()
let earlierDate = Date(timeIntervalSinceNow: -2 * 24 * 3600)
switch Date() {
case now..<earlierDate:
print("hello")
default:
print("nay")
}
@billibala
Copy link
Author

screen shot 2018-05-22 at 12 07 33 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment