Add startOfToday and nullability annotations to NSCalendar+RSCore.

This commit is contained in:
Brent Simmons 2017-11-19 12:11:56 -08:00
parent 8406cb9b8e
commit 1cc532faa1
2 changed files with 11 additions and 0 deletions

View File

@ -8,9 +8,15 @@
@import Foundation;
NS_ASSUME_NONNULL_BEGIN
@interface NSCalendar (RSCore)
+ (NSCalendar *)rs_cachedCalendar;
+ (BOOL)rs_dateIsToday:(NSDate *)d;
+ (NSDate *)rs_startOfToday NS_SWIFT_NAME(startOfToday());
@end
NS_ASSUME_NONNULL_END

View File

@ -73,4 +73,9 @@ static NSCalendar *cachedCalendar = nil;
}
+ (NSDate *)rs_startOfToday {
return [[self rs_cachedCalendar] startOfDayForDate:[NSDate date]];
}
@end