Merge pull request #3130 from dreampiggy/project_ios9_xcode11

Bumped the min deployment target version to iOS 9, macOS 10.11. Bumped the min Xcode version to Xcode 11
This commit is contained in:
DreamPiggy 2020-11-22 18:10:37 +08:00 committed by GitHub
commit a6857352b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 33 additions and 65 deletions

View File

@ -176,7 +176,7 @@ GCC_WARN_UNUSED_VARIABLE = YES
HEADER_SEARCH_PATHS = $(inherited) HEADER_SEARCH_PATHS = $(inherited)
// Code will load on this and later versions of iOS. Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs. // Code will load on this and later versions of iOS. Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs.
IPHONEOS_DEPLOYMENT_TARGET = 8.0 IPHONEOS_DEPLOYMENT_TARGET = 9.0
// This is a list of paths to be added to the `runpath` search path list for the image being created. At runtime, `dyld` uses the `runpath` when searching for dylibs whose load path begins with `@rpath/`. // This is a list of paths to be added to the `runpath` search path list for the image being created. At runtime, `dyld` uses the `runpath` when searching for dylibs whose load path begins with `@rpath/`.
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
@ -185,7 +185,7 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/
LIBRARY_SEARCH_PATHS = $(inherited) LIBRARY_SEARCH_PATHS = $(inherited)
// Code will load on this and later versions of macOS. Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs. // Code will load on this and later versions of macOS. Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs.
MACOSX_DEPLOYMENT_TARGET = 10.10 MACOSX_DEPLOYMENT_TARGET = 10.11
// Options defined in this setting are passed to invocations of the linker. // Options defined in this setting are passed to invocations of the linker.
OTHER_LDFLAGS = -ObjC OTHER_LDFLAGS = -ObjC

View File

@ -4,10 +4,6 @@
#import <Availability.h> #import <Availability.h>
#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif
#ifdef __OBJC__ #ifdef __OBJC__
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>

View File

@ -6,8 +6,8 @@ import PackageDescription
let package = Package( let package = Package(
name: "SDWebImage", name: "SDWebImage",
platforms: [ platforms: [
.macOS(.v10_10), .macOS(.v10_11),
.iOS(.v8), .iOS(.v9),
.tvOS(.v9), .tvOS(.v9),
.watchOS(.v2) .watchOS(.v2)
], ],

12
Podfile
View File

@ -23,19 +23,19 @@ workspace 'SDWebImage.xcworkspace'
# Example Project # Example Project
target 'SDWebImage iOS Demo' do target 'SDWebImage iOS Demo' do
project example_project_path project example_project_path
platform :ios, '8.0' platform :ios, '9.0'
all_example_pods all_example_pods
end end
target 'SDWebImage OSX Demo' do target 'SDWebImage OSX Demo' do
project example_project_path project example_project_path
platform :osx, '10.10' platform :osx, '10.11'
all_example_pods all_example_pods
end end
target 'SDWebImage TV Demo' do target 'SDWebImage TV Demo' do
project example_project_path project example_project_path
platform :tvos, '9.2' platform :tvos, '9.0'
all_example_pods all_example_pods
end end
@ -48,18 +48,18 @@ end
# Test Project # Test Project
target 'Tests iOS' do target 'Tests iOS' do
project test_project_path project test_project_path
platform :ios, '8.0' platform :ios, '9.0'
all_test_pods all_test_pods
end end
target 'Tests Mac' do target 'Tests Mac' do
project test_project_path project test_project_path
platform :osx, '10.10' platform :osx, '10.11'
all_test_pods all_test_pods
end end
target 'Tests TV' do target 'Tests TV' do
project test_project_path project test_project_path
platform :tvos, '9.2' platform :tvos, '9.0'
all_test_pods all_test_pods
end end

View File

@ -93,14 +93,15 @@ You can use those directly, or create similar components of your own, by using t
## Requirements ## Requirements
- iOS 8.0 or later - iOS 9.0 or later
- tvOS 9.0 or later - tvOS 9.0 or later
- watchOS 2.0 or later - watchOS 2.0 or later
- macOS 10.10 or later (10.15 for Catalyst) - macOS 10.11 or later (10.15 for Catalyst)
- Xcode 10.0 or later - Xcode 11.0 or later
#### Backwards compatibility #### Backwards compatibility
- For iOS 8, macOS 10.10 or Xcode < 11, use [any 5.x version up to 5.9.5](https://github.com/SDWebImage/SDWebImage/releases/tag/5.9.5)
- For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.4.6](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.6) - For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.4.6](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.6)
- For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0) - For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0)
- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/tag/3.7.6) - For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/tag/3.7.6)

View File

@ -2,8 +2,8 @@ Pod::Spec.new do |s|
s.name = 'SDWebImage' s.name = 'SDWebImage'
s.version = '5.9.5' s.version = '5.9.5'
s.osx.deployment_target = '10.10' s.osx.deployment_target = '10.11'
s.ios.deployment_target = '8.0' s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '9.0' s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0' s.watchos.deployment_target = '2.0'
@ -37,9 +37,9 @@ Pod::Spec.new do |s|
end end
s.subspec 'MapKit' do |mk| s.subspec 'MapKit' do |mk|
mk.osx.deployment_target = '10.10' mk.osx.deployment_target = '10.11'
mk.ios.deployment_target = '8.0' mk.ios.deployment_target = '9.0'
mk.tvos.deployment_target = '9.2' mk.tvos.deployment_target = '9.0'
mk.source_files = 'SDWebImageMapKit/MapKit/*.{h,m}' mk.source_files = 'SDWebImageMapKit/MapKit/*.{h,m}'
mk.framework = 'MapKit' mk.framework = 'MapKit'
mk.dependency 'SDWebImage/Core' mk.dependency 'SDWebImage/Core'

View File

@ -13,14 +13,6 @@
#import <MobileCoreServices/MobileCoreServices.h> #import <MobileCoreServices/MobileCoreServices.h>
#endif #endif
// iOS 8 Image/IO framework binary does not contains these APNG constants, so we define them. Thanks Apple :)
// We can not use runtime @available check for this issue, because it's a global symbol and should be loaded during launch time by dyld. So hack if the min deployment target version < iOS 9.0, whatever it running on iOS 9+ or not.
#if (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
const CFStringRef kCGImagePropertyAPNGLoopCount = (__bridge CFStringRef)@"LoopCount";
const CFStringRef kCGImagePropertyAPNGDelayTime = (__bridge CFStringRef)@"DelayTime";
const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef)@"UnclampedDelayTime";
#endif
@implementation SDImageAPNGCoder @implementation SDImageAPNGCoder
+ (instancetype)sharedCoder { + (instancetype)sharedCoder {

View File

@ -18,8 +18,6 @@ static NSString * kSDCGImagePropertyHEICSUnclampedDelayTime = @"UnclampedDelayTi
@implementation SDImageHEICCoder @implementation SDImageHEICCoder
+ (void)initialize { + (void)initialize {
#if __IPHONE_13_0 || __TVOS_13_0 || __MAC_10_15 || __WATCHOS_6_0
// Xcode 11
if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) { if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) {
// Use SDK instead of raw value // Use SDK instead of raw value
kSDCGImagePropertyHEICSDictionary = (__bridge NSString *)kCGImagePropertyHEICSDictionary; kSDCGImagePropertyHEICSDictionary = (__bridge NSString *)kCGImagePropertyHEICSDictionary;
@ -27,7 +25,6 @@ static NSString * kSDCGImagePropertyHEICSUnclampedDelayTime = @"UnclampedDelayTi
kSDCGImagePropertyHEICSDelayTime = (__bridge NSString *)kCGImagePropertyHEICSDelayTime; kSDCGImagePropertyHEICSDelayTime = (__bridge NSString *)kCGImagePropertyHEICSDelayTime;
kSDCGImagePropertyHEICSUnclampedDelayTime = (__bridge NSString *)kCGImagePropertyHEICSUnclampedDelayTime; kSDCGImagePropertyHEICSUnclampedDelayTime = (__bridge NSString *)kCGImagePropertyHEICSUnclampedDelayTime;
} }
#endif
} }
+ (instancetype)sharedCoder { + (instancetype)sharedCoder {

View File

@ -12,13 +12,6 @@
#import "SDWebImageDownloaderResponseModifier.h" #import "SDWebImageDownloaderResponseModifier.h"
#import "SDWebImageDownloaderDecryptor.h" #import "SDWebImageDownloaderDecryptor.h"
// iOS 8 Foundation.framework extern these symbol but the define is in CFNetwork.framework. We just fix this without import CFNetwork.framework
#if ((__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0) || (__MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11))
const float NSURLSessionTaskPriorityHigh = 0.75;
const float NSURLSessionTaskPriorityDefault = 0.5;
const float NSURLSessionTaskPriorityLow = 0.25;
#endif
static NSString *const kProgressCallbackKey = @"progress"; static NSString *const kProgressCallbackKey = @"progress";
static NSString *const kCompletedCallbackKey = @"completed"; static NSString *const kCompletedCallbackKey = @"completed";

View File

@ -14,16 +14,6 @@
#import <QuartzCore/QuartzCore.h> #import <QuartzCore/QuartzCore.h>
#endif #endif
#if SD_UIKIT
#if __IPHONE_13_0 || __TVOS_13_0 || __MAC_10_15
// Xcode 11
#else
// Supports Xcode 10 users, for those users, define these enum
static NSInteger UIActivityIndicatorViewStyleMedium = 100;
static NSInteger UIActivityIndicatorViewStyleLarge = 101;
#endif
#endif
#pragma mark - Activity Indicator #pragma mark - Activity Indicator
@interface SDWebImageActivityIndicator () @interface SDWebImageActivityIndicator ()

View File

@ -63,7 +63,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
[self waitForExpectationsWithCommonTimeout]; [self waitForExpectationsWithCommonTimeout];
@ -130,7 +130,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
[self waitForExpectationsWithCommonTimeoutUsingHandler:^(NSError * _Nullable error) { [self waitForExpectationsWithCommonTimeoutUsingHandler:^(NSError * _Nullable error) {
@ -145,7 +145,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else if (finished) { } else if (finished) {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} else { } else {
// progressive updates // progressive updates
} }
@ -161,7 +161,7 @@
if (!image && !data && error && finished) { if (!image && !data && error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
[self waitForExpectationsWithCommonTimeout]; [self waitForExpectationsWithCommonTimeout];
@ -227,7 +227,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
@ -243,7 +243,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
[self waitForExpectationsWithCommonTimeout]; [self waitForExpectationsWithCommonTimeout];
@ -256,7 +256,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
[self waitForExpectationsWithCommonTimeout]; [self waitForExpectationsWithCommonTimeout];
@ -353,6 +353,8 @@
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if (allProgressCount > 0) { if (allProgressCount > 0) {
[expectation fulfill]; [expectation fulfill];
allProgressCount = 0;
return;
} else { } else {
XCTFail(@"Progress callback more than once"); XCTFail(@"Progress callback more than once");
} }
@ -370,7 +372,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else if (finished) { } else if (finished) {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} else { } else {
// progressive updates // progressive updates
} }
@ -385,7 +387,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else if (finished) { } else if (finished) {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} else { } else {
// progressive updates // progressive updates
} }
@ -422,7 +424,7 @@
if (image && data && !error && finished) { if (image && data && !error && finished) {
[expectation fulfill]; [expectation fulfill];
} else { } else {
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
expect(token2).toNot.beNil(); expect(token2).toNot.beNil();
@ -464,7 +466,7 @@
[expectation fulfill]; [expectation fulfill];
} else { } else {
NSLog(@"image = %@, data = %@, error = %@", image, data, error); NSLog(@"image = %@, data = %@, error = %@", image, data, error);
XCTFail(@"Something went wrong"); XCTFail(@"Something went wrong: %@", error.description);
} }
}]; }];
expect(token2).toNot.beNil(); expect(token2).toNot.beNil();
@ -622,13 +624,10 @@
SDWebImageDownloaderDecryptor *decryptor = [SDWebImageDownloaderDecryptor decryptorWithBlock:^NSData * _Nullable(NSData * _Nonnull data, NSURLResponse * _Nullable response) { SDWebImageDownloaderDecryptor *decryptor = [SDWebImageDownloaderDecryptor decryptorWithBlock:^NSData * _Nullable(NSData * _Nonnull data, NSURLResponse * _Nullable response) {
if (@available(iOS 13, macOS 10.15, tvOS 13, *)) { if (@available(iOS 13, macOS 10.15, tvOS 13, *)) {
return [data decompressedDataUsingAlgorithm:NSDataCompressionAlgorithmZlib error:nil]; return [data decompressedDataUsingAlgorithm:NSDataCompressionAlgorithmZlib error:nil];
} else if (@available (iOS 9, macOS 10.11, tvOS 9, *)) { } else {
NSMutableData *decodedData = [NSMutableData dataWithLength:10 * data.length]; NSMutableData *decodedData = [NSMutableData dataWithLength:10 * data.length];
compression_decode_buffer((uint8_t *)decodedData.bytes, decodedData.length, data.bytes, data.length, nil, COMPRESSION_ZLIB); compression_decode_buffer((uint8_t *)decodedData.bytes, decodedData.length, data.bytes, data.length, nil, COMPRESSION_ZLIB);
return [decodedData copy]; return [decodedData copy];
} else {
// iOS 8 does not have built-in Zlib support, just mock the data
return base64PNGData;
} }
}]; }];
// Note this is not a Zip Archive, just PNG raw buffer data using zlib compression // Note this is not a Zip Archive, just PNG raw buffer data using zlib compression