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

View File

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