In my application I have a list of NSDate instances. At one point I need to seperate the dates which are past to today ie `[NSDate date]` (earlier to morning 12)
And I have used the logic like below. I feel there must be a better logic than this, so help me if there is better solution. 

I pass the date instance as an argument to this method which will return a BOOL value corresponding to my requirement.

```
-(BOOL)checkIfPast:(NSDate *)date
{
    NSDate *today=[NSDate date];
    NSUInteger dateFlags = NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit;
    NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components1=[gregorianCalendar components:dateFlags fromDate:today];
    NSDateComponents *components2=[gregorianCalendar components:dateFlags fromDate:date];
    if (components2.day-components1.day<0) {
        return YES;
    }
    else
    {
        return NO;
    }
}

```