I have tried this snippet (in Xcode 8 Beta 6), and it is working fine.
let date1 = Date()
let date2 = Date().addingTimeInterval(100)
if date1 == date2 { ... }
else if date1 > date2 { ... }
else if date1 < date2 { ... }
More Related Contents:
- Type ‘Any’ Has no Subscript Members in Xcode 8.1 Swift 3
- Populating information in swift 3 for iPad
- iOS/Swift: Making the source code of an app visible?
- How to localise a string inside the iOS info.plist file?
- Swift saving and retrieving custom object from UserDefaults
- AnyObject not working in Xcode8 beta6?
- How to program a delay in Swift 3
- How to implement method swizzling swift 3.0?
- How to create managedObjectContext using Swift 3 in Xcode 8?
- Xcode 9 Swift Language Version (SWIFT_VERSION)
- Xcode – Error creating LLDB target
- Can’t Hide Status Bar—Swift 3, [duplicate]
- How to push and present to UIViewController programmatically without segue in iOS Swift 3
- Swift 3 iOS compatibility
- Xcode error: Failed to prepare device for development
- Quitting app causes error “Message from debugger: Terminated due to signal 9”
- How do I install CocoaPods?
- Xcode 4: create IPA file instead of .xcarchive
- ld: library not found for -lstdc++.6
- Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler
- How do you make a background image scale to screen size in swift?
- The code signature version is no longer supported
- Flutter build iOS got error: Requested but did not find extension point with identifier
- Is it possible to opt your iPad app out of multitasking on iOS 9
- iPhone app under test crashes after a few days
- Xcode 5.1: missing required architecture arm64
- Duplicate Symbols for Architecture arm64
- How to clear or clean specific pod from the local cocoapods cache
- Can’t submit apps to AppStore: ERROR ITMS-90534: “Invalid Toolchain
- UISlider that snaps to a fixed number of steps (like Text Size in the iOS 7 Settings app)