From e05ff173bf567c2d37c9f04e0fa7c913e4e5a08b Mon Sep 17 00:00:00 2001 From: Luiz Rodrigo Martins Barbosa Date: Tue, 8 Sep 2020 21:48:33 +0200 Subject: [PATCH] Apply paging offset fix only on Xcode 12 (#11) --- .../Components/SwiftUI/UIKit Wrappers/PagingScrollView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/UIExtensions/Components/SwiftUI/UIKit Wrappers/PagingScrollView.swift b/Sources/UIExtensions/Components/SwiftUI/UIKit Wrappers/PagingScrollView.swift index f01db5c..4cca48b 100644 --- a/Sources/UIExtensions/Components/SwiftUI/UIKit Wrappers/PagingScrollView.swift +++ b/Sources/UIExtensions/Components/SwiftUI/UIKit Wrappers/PagingScrollView.swift @@ -176,9 +176,11 @@ extension PagingScrollView { /// Since the HStack is centered by default this offset actually moves it entirely to the left /// - Parameter proxy: Proxy that contains this view. private func stackOffset(for proxy: GeometryProxy) -> CGFloat { - if #available(iOS 14, *) { + #if swift(>=5.3) + if #available(iOS 14.0, *) { return 0 } + #endif let remainingSpace = contentWidth(for: proxy) - pageWidth(for: proxy)