In a swift playground, I have been using
NSDate.date()
But, this always appears with the time element appended. For my app I need to ignor
In Swift 4:
func compareDate(date1:Date, date2:Date) -> Bool { let order = NSCalendar.current.compare(date1, to: date2, toGranularity: .day) switch order { case .orderedSame: return true default: return false } }