Skip to content

Commit

Permalink
Add a documentation for the .safariView(isPresented:content:)
Browse files Browse the repository at this point in the history
  • Loading branch information
stleamist committed May 17, 2020
1 parent 46a2231 commit 2a03caf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

# FullScreenSafariView

A way to present a full-screen SFSafariViewController in SwiftUI.
A clean way to present a full-screen SFSafariViewController with a push transition in SwiftUI.
5 changes: 5 additions & 0 deletions Sources/FullScreenSafariView/FullScreenSafariView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ struct SafariViewModifier: ViewModifier {

public extension View {

/// Presents a `SFSafariViewController`.
///
/// - Parameters:
/// - isPresented: A `Binding` to whether the `SFSafariViewController` is presented.
/// - content: A closure returning the `URL` to load.
func safariView(isPresented: Binding<Bool>, content: () -> URL) -> some View {
let url = content()
return self.modifier(SafariViewModifier(isPresented: isPresented, url: url))
Expand Down

0 comments on commit 2a03caf

Please sign in to comment.