view raw
Tom Coomer Tom Coomer - 11 months ago 82
Swift Question

Check if date is before current date (Swift)

I would like to check if a NSDate is before (in the past) by comparing it to the current date. How would I do this?



I find the earlierDate methode.

if Date1.earlierDate(Date2).isEqualToDate(Date1)  {
            print(Date1 is earlier than Date2)

You have also the laterDate