How can i compare two dates (NSDate) in Swift 3 and get the days between them?
问题 How can I compare two dates in Swift 3? I found many solutions for other Swift versions, but they doesn't work for me. let clickedDay:String = currentcell.DayLabel.text! let currentDate = NSDate() let currentDay = "" //want the current day let dateFormatter = DateFormatter() var dateAsString = "" if Int(clickedDay)! < 10 { dateAsString = "0" + clickedDay + "-11-2016 GMT" } else { dateAsString = clickedDay + "-11-2016 GMT" } dateFormatter.dateFormat = "dd-MM-yyyy zzz" let clickedDate =