You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SafariView/Presentation/BoolPresentation.swift
-56Lines changed: 0 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -86,62 +86,6 @@ public extension View {
86
86
)
87
87
}
88
88
89
-
/// Presents a ``SafariView`` when a binding to a Boolean value that you provide is `true`.
90
-
///
91
-
/// Use this method when you want to present a ``SafariView`` to the user when a Boolean value you provide is true.
92
-
/// The example below displays a modal view of the mockup for a software license agreement when the user toggles the `isShowingSafari` variable by clicking or tapping on the “Show License Agreement” button:
93
-
///
94
-
/// ```swift
95
-
/// import Foundation
96
-
/// import SafariView
97
-
/// import SwiftUI
98
-
///
99
-
/// struct ShowLicenseAgreement: View {
100
-
///
101
-
/// let licenseAgreementURL: URL
102
-
///
103
-
/// @State private var isShowingSafari = false
104
-
///
105
-
/// var body: some View {
106
-
/// Button {
107
-
/// isShowingSafari.toggle()
108
-
/// } label: {
109
-
/// Text("Show License Agreement")
110
-
/// }
111
-
/// .safari(isPresented: $isShowingSafari,
112
-
/// url: licenseAgreementURL
113
-
/// onDismiss: didDismiss)
114
-
/// }
115
-
///
116
-
/// func didDismiss() {
117
-
/// // Handle the dismissing action.
118
-
/// }
119
-
///
120
-
/// }
121
-
/// ```
122
-
///
123
-
/// - Parameters:
124
-
/// - isPresented: A binding to a Boolean value that determines whether to present the ``SafariView`` that you create in the modifier’s content closure.
125
-
/// - url: The URL to load in the presented ``SafariView``
126
-
/// - onDismiss: The closure to execute when dismissing the ``SafariView``
// copies of the Software, and to permit persons to whom the Software is
13
+
// furnished to do so, subject to the following conditions:
14
+
//
15
+
// The above copyright notice and this permission notice shall be included in all
16
+
// copies or substantial portions of the Software.
17
+
//
18
+
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+
// SOFTWARE.
25
+
26
+
import Foundation
27
+
import SwiftUI
28
+
29
+
@available(iOS 14.0, macCatalyst 14.0,*)
30
+
publicextensionView{
31
+
32
+
/// Presents a ``SafariView`` when a binding to a Boolean value that you provide is `true`.
33
+
///
34
+
/// Use this method when you want to present a ``SafariView`` to the user when a Boolean value you provide is true.
35
+
/// The example below displays a modal view of the mockup for a software license agreement when the user toggles the `isShowingSafari` variable by clicking or tapping on the “Show License Agreement” button:
36
+
///
37
+
/// ```swift
38
+
/// import Foundation
39
+
/// import SafariView
40
+
/// import SwiftUI
41
+
///
42
+
/// struct ShowLicenseAgreement: View {
43
+
///
44
+
/// let licenseAgreementURL: URL
45
+
///
46
+
/// @State private var isShowingSafari = false
47
+
///
48
+
/// var body: some View {
49
+
/// Button {
50
+
/// isShowingSafari.toggle()
51
+
/// } label: {
52
+
/// Text("Show License Agreement")
53
+
/// }
54
+
/// .safari(isPresented: $isShowingSafari,
55
+
/// url: licenseAgreementURL
56
+
/// onDismiss: didDismiss)
57
+
/// }
58
+
///
59
+
/// func didDismiss() {
60
+
/// // Handle the dismissing action.
61
+
/// }
62
+
///
63
+
/// }
64
+
/// ```
65
+
///
66
+
/// - Parameters:
67
+
/// - isPresented: A binding to a Boolean value that determines whether to present the ``SafariView`` that you create in the modifier’s content closure.
68
+
/// - url: The URL to load in the presented ``SafariView``
69
+
/// - onDismiss: The closure to execute when dismissing the ``SafariView``
0 commit comments