Merge pull request #2372 from dreampiggy/project_upgrade_xcode_9

Follow App Store submit rule, upgrade the min Xcode version to Xcode 9.0. Using `@available` and `API_AVAILABLE` to check API availability
This commit is contained in:
DreamPiggy 2018-07-06 14:10:22 +08:00 committed by GitHub
commit 2b4687cccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 35 deletions

View File

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
@ -14,9 +18,9 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>

View File

@ -37,7 +37,7 @@ This library provides an async image downloader with cache support. For convenie
- 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 - macOS 10.10 or later
- Xcode 7.3 or later - Xcode 9.0 or later
#### Backwards compatibility #### Backwards compatibility

View File

@ -203,20 +203,15 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over
static CGColorSpaceRef colorSpace; static CGColorSpaceRef colorSpace;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
BOOL shouldUseSRGB = NO;
#if SD_UIKIT #if SD_UIKIT
NSProcessInfo *processInfo = [NSProcessInfo processInfo]; if (@available(iOS 9.0, tvOS 9.0, *)) {
shouldUseSRGB = processInfo.operatingSystemVersion.majorVersion >= 9;
#endif
if (shouldUseSRGB) {
// This is what iOS/tvOS device used colorspace, combined with right bitmapInfo, even without decode, can still avoid extra CA::Render::copy_image(which marked `Color Copied Images` from Instruments)
colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
} else { } else {
colorSpace = CGColorSpaceCreateDeviceRGB(); colorSpace = CGColorSpaceCreateDeviceRGB();
} }
#pragma clang diagnostic pop #else
colorSpace = CGColorSpaceCreateDeviceRGB();
#endif
}); });
return colorSpace; return colorSpace;
} }

View File

@ -240,28 +240,15 @@
static BOOL canDecode = NO; static BOOL canDecode = NO;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
#if TARGET_OS_SIMULATOR || SD_WATCH #if TARGET_OS_SIMULATOR || SD_WATCH
canDecode = NO; canDecode = NO;
#elif SD_MAC #else
NSProcessInfo *processInfo = [NSProcessInfo processInfo]; if (@available(iOS 11.0, tvOS 11.0, macOS 10.13, *)) {
if ([processInfo respondsToSelector:@selector(operatingSystemVersion)]) { canDecode = YES;
// macOS 10.13+
canDecode = processInfo.operatingSystemVersion.minorVersion >= 13;
} else {
canDecode = NO;
}
#elif SD_UIKIT
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
if ([processInfo respondsToSelector:@selector(operatingSystemVersion)]) {
// iOS 11+ && tvOS 11+
canDecode = processInfo.operatingSystemVersion.majorVersion >= 11;
} else { } else {
canDecode = NO; canDecode = NO;
} }
#endif #endif
#pragma clang diagnostic pop
}); });
return canDecode; return canDecode;
} }

View File

@ -63,10 +63,6 @@
#define UIColor NSColor #define UIColor NSColor
#endif #endif
#else #else
#if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0
#error SDWebImage doesn't support Deployment Target version < 5.0
#endif
#if SD_UIKIT #if SD_UIKIT
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#endif #endif

View File

@ -41,7 +41,7 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
/** /**
The timing function used for all animations within this transition animation (macOS). The timing function used for all animations within this transition animation (macOS).
*/ */
@property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction NS_AVAILABLE_MAC(10_7); @property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction API_UNAVAILABLE(ios, tvos, watchos);
/** /**
A mask of options indicating how you want to perform the animations. A mask of options indicating how you want to perform the animations.
*/ */