diff --git a/Package.resolved b/Package.resolved index 51ceeeb48..46ffb78f1 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "fe45a2d882851bdb91759a41c86703d3fa367079c5a0000f65a7346f37b70551", "pins" : [ { "identity" : "swift-docc-plugin", @@ -23,10 +24,10 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nicklockwood/SwiftFormat", "state" : { - "revision" : "9e5d0d588ab6e271fe9887ec3dde21d544d4b080", - "version" : "0.53.5" + "revision" : "9df3b01f477163b33d5e63c5e2e5b9f946a49c56", + "version" : "0.53.6" } } ], - "version" : 2 + "version" : 3 } diff --git a/Package.swift b/Package.swift index 5d6ec2402..a536d9a0f 100644 --- a/Package.swift +++ b/Package.swift @@ -37,7 +37,7 @@ let package = Package( ), .package( url: "https://github.com/nicklockwood/SwiftFormat", - exact: "0.53.5" + exact: "0.53.6" ) ], targets: [ diff --git a/Sources/SafariUI/SafariUI.docc/SafariView.md b/Sources/SafariUI/SafariUI.docc/SafariView.md index 9fb462ac3..552dc30cb 100644 --- a/Sources/SafariUI/SafariUI.docc/SafariView.md +++ b/Sources/SafariUI/SafariUI.docc/SafariView.md @@ -21,11 +21,13 @@ You can present a `SafariView` using the built-in presentation view modifiers: - ``SwiftUI/View/safari(isPresented:presentationStyle:onDismiss:safariView:)`` - ``SwiftUI/View/safari(isPresented:url:presentationStyle:onDismiss:)`` -- ``SwiftUI/View/safari(item:onDismiss:safariView:)`` -- ``SwiftUI/View/safari(item:id:onDismiss:safariView:)`` -- ``SwiftUI/View/safari(url:onDismiss:)`` +- ``SwiftUI/View/safari(item:presentationStyle:onDismiss:safariView:)`` +- ``SwiftUI/View/safari(item:id:presentationStyle:onDismiss:safariView:)`` +- ``SwiftUI/View/safari(url:presentationStyle:onDismiss:)`` -You can also use sheet presentation, or any other presentation mechanism of your choice. +These modifiers use the standard presentation mechanism that you would otherwise use to present an `SFSafariViewController` in a UIKit application. To customize the behavior of the modifier, see the ``SafariView/PresentationStyle`` enumeration. + +A `SafariView` is also a regular SwiftUI view, and can be presented through any other mechanism of your choice. ## Topics @@ -39,6 +41,10 @@ You can also use sheet presentation, or any other presentation mechanism of your - ``DismissButtonStyle`` +### Presentation Options + +- ``PresentationStyle`` + ### Connection Prewarming - ``prewarmConnections(to:)`` diff --git a/Sources/SafariUI/SafariUI.docc/View.md b/Sources/SafariUI/SafariUI.docc/View.md index 4a1e3988d..72efda562 100644 --- a/Sources/SafariUI/SafariUI.docc/View.md +++ b/Sources/SafariUI/SafariUI.docc/View.md @@ -19,9 +19,9 @@ SwiftUI view modifiers used to configure a ``SafariView`` or a ``WebAuthenticati - ``SwiftUI/View/safari(isPresented:presentationStyle:onDismiss:safariView:)`` - ``SwiftUI/View/safari(isPresented:url:presentationStyle:onDismiss:)`` -- ``SwiftUI/View/safari(item:onDismiss:safariView:)`` -- ``SwiftUI/View/safari(item:id:onDismiss:safariView:)`` -- ``SwiftUI/View/safari(url:onDismiss:)`` +- ``SwiftUI/View/safari(item:presentationStyle:onDismiss:safariView:)`` +- ``SwiftUI/View/safari(item:id:presentationStyle:onDismiss:safariView:)`` +- ``SwiftUI/View/safari(isPresented:presentationStyle:onDismiss:safariView:)`` ### SafarView Custom Activities diff --git a/Sources/SafariView/Presentation/BoolPresentation.swift b/Sources/SafariView/Presentation/BoolPresentation.swift index d2c8877b3..d097dd27c 100644 --- a/Sources/SafariView/Presentation/BoolPresentation.swift +++ b/Sources/SafariView/Presentation/BoolPresentation.swift @@ -91,7 +91,6 @@ public extension View { } -@available(iOS 14.0, visionOS 1.0, macCatalyst 14.0, *) private struct IsPresentedModifier: ViewModifier { // MARK: - Initializer diff --git a/Sources/SafariView/Presentation/PresentationStyle.swift b/Sources/SafariView/Presentation/PresentationStyle.swift index ee9447fd9..439a2582f 100644 --- a/Sources/SafariView/Presentation/PresentationStyle.swift +++ b/Sources/SafariView/Presentation/PresentationStyle.swift @@ -26,11 +26,21 @@ @available(iOS 14.0, visionOS 1.0, macCatalyst 14.0, *) public extension SafariView { - enum PresentationStyle: Equatable, Hashable, Sendable, Codable { + /// The available presentation styles of a ``SafariView`` + enum PresentationStyle: Equatable, Hashable, Sendable { + + /// Standard Presentation case standard + + /// Form Sheet Presentation case formSheet + + /// Page Sheet Presentation case pageSheet + + /// Default Presentation public static let `default`: PresentationStyle = .standard + } }