From a4c737726f8a6b888b2f9fce20cac66929339be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=C3=AF=20Roycourt?= Date: Mon, 12 Oct 2020 17:26:02 +0200 Subject: [PATCH 1/2] Allow build for Xcode versions prior Xcode 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `.mac` case comes for iOS 14 with Xcode 12 & swift 5.3. This allows the compilation with older Xcode versions (prior Xcode 12) that come with olderĀ an Swift compiler version. --- Sources/ToastView.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/ToastView.swift b/Sources/ToastView.swift index 6145968..add1d55 100644 --- a/Sources/ToastView.swift +++ b/Sources/ToastView.swift @@ -52,7 +52,9 @@ open class ToastView: UIView { case .pad: return 60 case .tv: return 90 case .carPlay: return 30 + #if swift(>=5.3) case .mac: return 60 + #endif // default values case .unspecified: fallthrough @unknown default: return 30 @@ -67,7 +69,9 @@ open class ToastView: UIView { case .pad: return 40 case .tv: return 60 case .carPlay: return 20 + #if swift(>=5.3) case .mac: return 40 + #endif // default values case .unspecified: fallthrough @unknown default: return 20 @@ -134,7 +138,9 @@ open class ToastView: UIView { case .pad: return .systemFont(ofSize: 16) case .tv: return .systemFont(ofSize: 20) case .carPlay: return .systemFont(ofSize: 12) + #if swift(>=5.3) case .mac: return .systemFont(ofSize: 16) + #endif // default values case .unspecified: fallthrough @unknown default: return .systemFont(ofSize: 12) From 60e07184b80be07621148c84ed842a10b622bc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20C=C5=93ur?= Date: Mon, 19 Oct 2020 09:30:23 +0800 Subject: [PATCH 2/2] Supporting Swift 4 on Xcode 12 --- Sources/ToastView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/ToastView.swift b/Sources/ToastView.swift index add1d55..f337629 100644 --- a/Sources/ToastView.swift +++ b/Sources/ToastView.swift @@ -52,7 +52,7 @@ open class ToastView: UIView { case .pad: return 60 case .tv: return 90 case .carPlay: return 30 - #if swift(>=5.3) + #if compiler(>=5.3) case .mac: return 60 #endif // default values @@ -69,7 +69,7 @@ open class ToastView: UIView { case .pad: return 40 case .tv: return 60 case .carPlay: return 20 - #if swift(>=5.3) + #if compiler(>=5.3) case .mac: return 40 #endif // default values @@ -138,7 +138,7 @@ open class ToastView: UIView { case .pad: return .systemFont(ofSize: 16) case .tv: return .systemFont(ofSize: 20) case .carPlay: return .systemFont(ofSize: 12) - #if swift(>=5.3) + #if compiler(>=5.3) case .mac: return .systemFont(ofSize: 16) #endif // default values