From 1311b59aeb995da61d35aeb24497c2cdcdbbb70a Mon Sep 17 00:00:00 2001 From: David Beck Date: Mon, 30 Nov 2020 14:33:04 -0800 Subject: [PATCH] Change iOS deployment target for Xcode 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the warning about iOS 8 no longer being supported in Xcode 12 while maintaining support for older versions of Xcode. Technically checking the compiler version isn’t an exact 1:1 for checking for Xcode version, but in practice should work in all scenarios. --- Package.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 5629a5ac..c1d418aa 100644 --- a/Package.swift +++ b/Package.swift @@ -3,9 +3,18 @@ import PackageDescription +var platforms: [SupportedPlatform] { + #if compiler(<5.3) + return [.iOS(.v8)] + #else + // Xcode 12 (which ships with Swift 5.3) drops support for iOS 8 + return[.iOS(.v9)] + #endif +} + let package = Package( name: "TOCropViewController", - platforms: [.iOS(.v8)], + platforms: platforms, products: [ .library( name: "TOCropViewController",