I find the earlierDate
method.
if date1.earlierDate(date2).isEqualToDate(date1) {
print("date1 is earlier than date2")
}
You also have the laterDate
method.
Swift 3 to swift 5:
if date1 < date2 {
print("date1 is earlier than date2")
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…