Supresss the deprecation warning when min deployment target version set to iOS 13+ or macCatalyst

This commit is contained in:
DreamPiggy 2020-03-05 18:44:50 +08:00
parent b54cdcc4bb
commit bd33f4179d
2 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,8 @@
#endif #endif
} }
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (SDGraphicsImageRendererFormatRange)preferredRange { - (SDGraphicsImageRendererFormatRange)preferredRange {
#if SD_UIKIT #if SD_UIKIT
if (@available(iOS 10.0, tvOS 10.10, *)) { if (@available(iOS 10.0, tvOS 10.10, *)) {
@ -114,6 +116,7 @@
_preferredRange = preferredRange; _preferredRange = preferredRange;
#endif #endif
} }
#pragma clang diagnostic pop
- (instancetype)init { - (instancetype)init {
self = [super init]; self = [super init];

View File

@ -223,7 +223,10 @@
} }
} else { } else {
@try { @try {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
extendedData = [NSKeyedArchiver archivedDataWithRootObject:extendedObject]; extendedData = [NSKeyedArchiver archivedDataWithRootObject:extendedObject];
#pragma clang diagnostic pop
} @catch (NSException *exception) { } @catch (NSException *exception) {
NSLog(@"NSKeyedArchiver archive failed with exception: %@", exception); NSLog(@"NSKeyedArchiver archive failed with exception: %@", exception);
} }
@ -397,7 +400,10 @@
} }
} else { } else {
@try { @try {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
extendedObject = [NSKeyedUnarchiver unarchiveObjectWithData:extendedData]; extendedObject = [NSKeyedUnarchiver unarchiveObjectWithData:extendedData];
#pragma clang diagnostic pop
} @catch (NSException *exception) { } @catch (NSException *exception) {
NSLog(@"NSKeyedUnarchiver unarchive failed with exception: %@", exception); NSLog(@"NSKeyedUnarchiver unarchive failed with exception: %@", exception);
} }