From 693f592cb3443837632f9e6383ae15c33616b457 Mon Sep 17 00:00:00 2001 From: xfdev Date: Wed, 3 Feb 2021 10:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20iPhone=2012=20=E7=B3=BB?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YYCategories/Foundation/NSDate+YYAdd.h | 1 + YYCategories/Foundation/NSDate+YYAdd.m | 5 +++ YYCategories/UIKit/UIDevice+YYAdd.h | 21 ++++++++++++ YYCategories/UIKit/UIDevice+YYAdd.m | 46 ++++++++++++++++++++++++-- 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/YYCategories/Foundation/NSDate+YYAdd.h b/YYCategories/Foundation/NSDate+YYAdd.h index d281902..e790412 100644 --- a/YYCategories/Foundation/NSDate+YYAdd.h +++ b/YYCategories/Foundation/NSDate+YYAdd.h @@ -40,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) BOOL isLeapYear; ///< Weather the year is leap year @property (nonatomic, readonly) BOOL isToday; ///< Weather date is today (based on current locale) @property (nonatomic, readonly) BOOL isYesterday; ///< Weather date is yesterday (based on current locale) +@property (nonatomic, readonly) BOOL isTomorrow; ///< 明天 #pragma mark - Date modify ///============================================================================= diff --git a/YYCategories/Foundation/NSDate+YYAdd.m b/YYCategories/Foundation/NSDate+YYAdd.m index 9e27a5d..65b4d81 100644 --- a/YYCategories/Foundation/NSDate+YYAdd.m +++ b/YYCategories/Foundation/NSDate+YYAdd.m @@ -89,6 +89,11 @@ - (BOOL)isYesterday { return [added isToday]; } +- (BOOL)isTomorrow { + NSDate *added = [self dateByAddingDays:-1]; + return [added isToday]; +} + - (NSDate *)dateByAddingYears:(NSInteger)years { NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *components = [[NSDateComponents alloc] init]; diff --git a/YYCategories/UIKit/UIDevice+YYAdd.h b/YYCategories/UIKit/UIDevice+YYAdd.h index acc08d8..eab3568 100644 --- a/YYCategories/UIKit/UIDevice+YYAdd.h +++ b/YYCategories/UIKit/UIDevice+YYAdd.h @@ -189,3 +189,24 @@ NS_ASSUME_NONNULL_END #ifndef kiOS9Later #define kiOS9Later (kSystemVersion >= 9) #endif + +#ifndef kiOS10Later +#define kiOS10Later (kSystemVersion >= 10) +#endif + +#ifndef kiOS11Later +#define kiOS11Later (kSystemVersion >= 11) +#endif + +#ifndef kiOS12Later +#define kiOS12Later (kSystemVersion >= 12) +#endif + +#ifndef kiOS13Later +#define kiOS13Later (kSystemVersion >= 13) +#endif + +#ifndef kiOS14Later +#define kiOS14Later (kSystemVersion >= 14) +#endif + diff --git a/YYCategories/UIKit/UIDevice+YYAdd.m b/YYCategories/UIKit/UIDevice+YYAdd.m index 265810a..6f939d7 100644 --- a/YYCategories/UIKit/UIDevice+YYAdd.m +++ b/YYCategories/UIKit/UIDevice+YYAdd.m @@ -253,6 +253,18 @@ - (NSString *)machineModelName { @"Watch2,4" : @"Apple Watch Series 2 42mm", @"Watch2,6" : @"Apple Watch Series 1 38mm", @"Watch2,7" : @"Apple Watch Series 1 42mm", + @"Watch3,1" : @"Apple Watch Series 3 38mm",// from https://github.com/ibireme/YYCategories/pull/65/files + @"Watch3,2" : @"Apple Watch Series 3 42mm", + @"Watch3,3" : @"Apple Watch Series 3 38mm", + @"Watch3,4" : @"Apple Watch Series 3 42mm", + @"Watch4,1" : @"Apple Watch Series 4 40mm", + @"Watch4,2" : @"Apple Watch Series 4 44mm", + @"Watch4,3" : @"Apple Watch Series 4 40mm", + @"Watch4,4" : @"Apple Watch Series 4 44mm", + @"Watch5,1" : @"Apple Watch Series 5 40mm", + @"Watch5,2" : @"Apple Watch Series 5 44mm", + @"Watch5,3" : @"Apple Watch Series 5 40mm", + @"Watch5,4" : @"Apple Watch Series 5 44mm", @"iPod1,1" : @"iPod touch 1", @"iPod2,1" : @"iPod touch 2", @@ -260,6 +272,7 @@ - (NSString *)machineModelName { @"iPod4,1" : @"iPod touch 4", @"iPod5,1" : @"iPod touch 5", @"iPod7,1" : @"iPod touch 6", + @"iPod9,1" : @"7th Gen iPod",// from https://github.com/ibireme/YYCategories/pull/65/files @"iPhone1,1" : @"iPhone 1G", @"iPhone1,2" : @"iPhone 3G", @@ -278,12 +291,11 @@ - (NSString *)machineModelName { @"iPhone7,2" : @"iPhone 6", @"iPhone8,1" : @"iPhone 6s", @"iPhone8,2" : @"iPhone 6s Plus", - @"iPhone8,4" : @"iPhone SE", + @"iPhone8,4" : @"iPhone SE (1st generation)", @"iPhone9,1" : @"iPhone 7", @"iPhone9,2" : @"iPhone 7 Plus", @"iPhone9,3" : @"iPhone 7", @"iPhone9,4" : @"iPhone 7 Plus", - @"iPhone10,1" : @"iPhone 8", @"iPhone10,4" : @"iPhone 8", @"iPhone10,2" : @"iPhone 8 Plus", @@ -294,11 +306,14 @@ - (NSString *)machineModelName { @"iPhone11,2" : @"iPhone XS", @"iPhone11,6" : @"iPhone XS Max", @"iPhone11,4" : @"iPhone XS Max", - @"iPhone12,1" : @"iPhone 11", // FR: 2020.10.09 开始新增。@"iPhonexx" : @"iPhoneName", @"iPhone12,3" : @"iPhone 11 Pro", @"iPhone12,5" : @"iPhone 11 Pro Max", @"iPhone12,8" : @"iPhone SE (2nd generation)", // FR: 2020.10.09 结束。 + @"iPhone13,1" : @"iPhone 12 Mini", // from https://github.com/ibireme/YYCategories/pull/65/files + @"iPhone13,2" : @"iPhone 12", + @"iPhone13,3" : @"iPhone 12 Pro", + @"iPhone13,4" : @"iPhone 12 Pro Max", @"iPad1,1" : @"iPad 1", @"iPad2,1" : @"iPad 2 (WiFi)", @@ -341,10 +356,35 @@ - (NSString *)machineModelName { @"iPad7,5" : @"iPad (6th generation)", @"iPad7,6" : @"iPad (6th generation)", + // from https://github.com/ibireme/YYCategories/pull/65/files + @"iPad7,11" : @"iPad 7th Gen 10.2-inch (WiFi)", + @"iPad7,12" : @"iPad 7th Gen 10.2-inch (WiFi+Cellular)", + @"iPad8,1" : @"iPad Pro 11 inch 3rd Gen (WiFi)", + @"iPad8,2" : @"iPad Pro 11 inch 3rd Gen (1TB, WiFi)", + @"iPad8,3" : @"iPad Pro 11 inch 3rd Gen (WiFi+Cellular)", + @"iPad8,4" : @"iPad Pro 11 inch 3rd Gen (1TB, WiFi+Cellular)", + @"iPad8,5" : @"iPad Pro 12.9 inch 3rd Gen (WiFi)", + @"iPad8,6" : @"iPad Pro 12.9 inch 3rd Gen (1TB, WiFi)", + @"iPad8,7" : @"iPad Pro 12.9 inch 3rd Gen (WiFi+Cellular)", + @"iPad8,8" : @"iPad Pro 12.9 inch 3rd Gen (1TB, WiFi+Cellular)", + @"iPad8,9" : @"iPad Pro 11 inch 4th Gen (WiFi)", + @"iPad8,10" : @"iPad Pro 11 inch 4th Gen (WiFi+Cellular)", + @"iPad8,11" : @"iPad Pro 12.9 inch 4th Gen (WiFi)", + @"iPad8,12" : @"iPad Pro 12.9 inch 4th Gen (WiFi+Cellular)", + @"iPad11,1" : @"iPad mini 5th Gen (WiFi)", + @"iPad11,2" : @"iPad mini 5th Gen", + @"iPad11,3" : @"iPad Air 3rd Gen (WiFi)", + @"iPad11,4" : @"iPad Air 3rd Gen", + @"iPad11,6" : @"iPad 8th Gen (WiFi)", + @"iPad11,7" : @"iPad 8th Gen (WiFi+Cellular)", + @"iPad13,1" : @"iPad air 4th Gen (WiFi)", + @"iPad13,2" : @"iPad air 4th Gen (WiFi+Celular)", + @"AppleTV2,1" : @"Apple TV 2", @"AppleTV3,1" : @"Apple TV 3", @"AppleTV3,2" : @"Apple TV 3", @"AppleTV5,3" : @"Apple TV 4", + @"AppleTV6,2" : @"Apple TV 4K",// from https://github.com/xfdev/YYCategories/compare/master...YYKits:master @"i386" : @"Simulator x86", @"x86_64" : @"Simulator x64",