[Solved] Compare two date – Swift
You can convert the string to date using a dateFormatter then compare with the current date using an if statement import Foundation //convert string to date let dateFormatter = DateFormatter() dateFormatter.dateFormat = “yyyy-MM-dd” let myDate = dateFormatter.date(from: “2019-11-02”) //convert today’s date in the same formate let currentFormatter = DateFormatter() currentFormatter.dateStyle = .short currentFormatter.dateFormat = “yyyy-MM-dd” … Read more