diff --git a/Sources/UI/SwiftUI/View Modifiers/PhotoPreviewModifier.swift b/Sources/UI/SwiftUI/View Modifiers/PhotoPreviewModifier.swift index 5b741122..0e2e7751 100644 --- a/Sources/UI/SwiftUI/View Modifiers/PhotoPreviewModifier.swift +++ b/Sources/UI/SwiftUI/View Modifiers/PhotoPreviewModifier.swift @@ -8,7 +8,7 @@ import SwiftUI -@available(iOS 14.0, *) +@available(iOS 15.0, *) struct PhotoPreviewModifier: ViewModifier { @Binding var presented: Bool let items: [PhotoPreviewItem] @@ -26,7 +26,7 @@ struct PhotoPreviewModifier: ViewModifier { } } -@available(iOS 14.0, *) +@available(iOS 15.0, *) public extension View { func photoPreview( present: Binding, diff --git a/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreview.swift b/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreview.swift index a66d0258..115d58c2 100644 --- a/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreview.swift +++ b/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreview.swift @@ -9,7 +9,7 @@ #if os(iOS) import SwiftUI -@available(iOS 14.0, *) +@available(iOS 15.0, *) public struct PhotoPreview: View { let items: [PhotoPreviewItem] let configuration: PhotoPreviewConfiguration @@ -35,26 +35,24 @@ public struct PhotoPreview: View { } public var body: some View { - ZStack { - scrollView - .ignoresSafeArea() - if configuration.showDismissButton { - dismissView + scrollView + .ignoresSafeArea() + .overlay { + if configuration.showDismissButton { + dismissView + } } - } - .background( - configuration - .backgroundColor - .ignoresSafeArea() - .opacity(backgroundOpacity) - ) + .background( + configuration + .backgroundColor + .opacity(backgroundOpacity) + ) } } // MARK: - ViewBuilders -@available(iOS 14.0, *) +@available(iOS 15.0, *) extension PhotoPreview { - @ViewBuilder var scrollView: some View { GeometryReader { geometry in ScrollView(.horizontal, showsIndicators: false) { @@ -101,7 +99,7 @@ extension PhotoPreview { } // MARK: - Helpers -@available(iOS 14.0, *) +@available(iOS 15.0, *) extension PhotoPreview { enum Direction { case vertical @@ -196,7 +194,7 @@ extension PhotoPreview { } // MARK: - Gestures -@available(iOS 14.0, *) +@available(iOS 15.0, *) extension PhotoPreview { func dragGesture(with geometry: GeometryProxy) -> some Gesture { DragGesture() diff --git a/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreviewItemView.swift b/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreviewItemView.swift index c1ea7389..2e80cff1 100644 --- a/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreviewItemView.swift +++ b/Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreviewItemView.swift @@ -11,7 +11,7 @@ import Kingfisher #endif import SwiftUI -@available(iOS 14.0, *) +@available(iOS 15.0, *) struct PhotoPreviewItemView: View { typealias VoidHandler = () -> Swift.Void typealias DragHandler = (CGFloat) -> Swift.Void @@ -60,7 +60,7 @@ struct PhotoPreviewItemView: View { } // MARK: - Views -@available(iOS 14.0, *) +@available(iOS 15.0, *) extension PhotoPreviewItemView { var imageView: some View { Group { @@ -91,7 +91,7 @@ extension PhotoPreviewItemView { } // MARK: - Helper methods -@available(iOS 14.0, *) +@available(iOS 15.0, *) extension PhotoPreviewItemView { func endDrag(animated: Bool = true) { let imageWidth = screenSize.width * scale @@ -147,7 +147,7 @@ extension PhotoPreviewItemView { } // MARK: - Gestures -@available(iOS 14.0, *) +@available(iOS 15.0, *) extension PhotoPreviewItemView { var magnificationGesture: some Gesture { MagnificationGesture()