Skip to content

Commit f805d2a

Browse files
committed
WIP
1 parent 56a734f commit f805d2a

File tree

2 files changed

+55
-7
lines changed

2 files changed

+55
-7
lines changed

Sources/ViewTypes/WebView.swift

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,67 @@ import SwiftUI
55
///
66
/// ### iOS
77
///
8-
/// TODO
8+
/// ```swift
9+
/// struct ContentView: View {
10+
/// @State var url = URL(string: "https://example.com")!
11+
///
12+
/// var body: some View {
13+
/// WebView(url: url)
14+
/// .introspect(.webView, on: .iOS(.v26)) {
15+
/// print(type(of: $0)) // WKWebView
16+
/// }
17+
/// }
18+
/// }
19+
/// }
20+
/// ```
921
///
1022
/// ### tvOS
1123
///
12-
/// TODO
24+
/// ```swift
25+
/// struct ContentView: View {
26+
/// @State var url = URL(string: "https://example.com")!
27+
///
28+
/// var body: some View {
29+
/// WebView(url: url)
30+
/// .introspect(.webView, on: .tvOS(.v26)) {
31+
/// print(type(of: $0)) // WKWebView
32+
/// }
33+
/// }
34+
/// }
35+
/// }
36+
/// ```
1337
///
1438
/// ### macOS
1539
///
16-
/// TODO
40+
/// ```swift
41+
/// struct ContentView: View {
42+
/// @State var url = URL(string: "https://example.com")!
43+
///
44+
/// var body: some View {
45+
/// WebView(url: url)
46+
/// .introspect(.webView, on: .macOS(.v26)) {
47+
/// print(type(of: $0)) // WKWebView
48+
/// }
49+
/// }
50+
/// }
51+
/// }
52+
/// ```
1753
///
1854
/// ### visionOS
1955
///
20-
/// TODO
56+
/// ```swift
57+
/// struct ContentView: View {
58+
/// @State var url = URL(string: "https://example.com")!
59+
///
60+
/// var body: some View {
61+
/// WebView(url: url)
62+
/// .introspect(.webView, on: .visionOS(.v26)) {
63+
/// print(type(of: $0)) // WKWebView
64+
/// }
65+
/// }
66+
/// }
67+
/// }
68+
/// ```
2169
public struct WebViewType: IntrospectableViewType {}
2270

2371
#if canImport(WebKit)

Tests/Tests/ViewTypes/WebViewTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ final class WebViewTests: XCTestCase {
1818
VStack {
1919
WebView(url: nil)
2020
.introspect(
21-
.map,
21+
.webView,
2222
on: .iOS(.v26), .tvOS(.v26), .macOS(.v26), .visionOS(.v26),
2323
customize: spy0
2424
)
2525

2626
WebView(url: nil)
2727
.introspect(
28-
.map,
28+
.webView,
2929
on: .iOS(.v26), .tvOS(.v26), .macOS(.v26), .visionOS(.v26),
3030
customize: spy1
3131
)
3232

3333
WebView(url: nil)
3434
.introspect(
35-
.map,
35+
.webView,
3636
on: .iOS(.v26), .tvOS(.v26), .macOS(.v26), .visionOS(.v26),
3737
customize: spy2
3838
)

0 commit comments

Comments
 (0)