@@ -2,25 +2,54 @@ import SwiftUI
2
2
3
3
/// An abstract representation of the `TabView` type in SwiftUI.
4
4
///
5
+ /// ### iOS
6
+ ///
7
+ /// ```swift
8
+ /// struct ContentView: View {
9
+ /// var body: some View {
10
+ /// TabView {
11
+ /// Text("Tab 1").tabItem { Text("Tab 1") }
12
+ /// Text("Tab 2").tabItem { Text("Tab 2") }
13
+ /// }
14
+ /// .introspect(.tabView, on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
15
+ /// print(type(of: $0)) // UITabBarController
16
+ /// }
17
+ /// }
18
+ /// }
19
+ /// ```
20
+ ///
21
+ /// ### tvOS
22
+ ///
5
23
/// ```swift
6
24
/// struct ContentView: View {
7
25
/// var body: some View {
8
26
/// TabView {
9
27
/// Text("Tab 1").tabItem { Text("Tab 1") }
10
28
/// Text("Tab 2").tabItem { Text("Tab 2") }
11
29
/// }
12
- /// #if os(iOS) || os(tvOS)
13
- /// .introspect(.tabView, on: .iOS(.v13, .v14, .v15, .v16, .v17), .tvOS(.v13, .v14, .v15, .v16, .v17)) {
30
+ /// .introspect(.tabView, on: .tvOS(.v13, .v14, .v15, .v16, .v17)) {
14
31
/// print(type(of: $0)) // UITabBarController
15
32
/// }
16
- /// #elseif os(macOS)
33
+ /// }
34
+ /// }
35
+ /// ```
36
+ ///
37
+ /// ### macOS
38
+ ///
39
+ /// ```swift
40
+ /// struct ContentView: View {
41
+ /// var body: some View {
42
+ /// TabView {
43
+ /// Text("Tab 1").tabItem { Text("Tab 1") }
44
+ /// Text("Tab 2").tabItem { Text("Tab 2") }
45
+ /// }
17
46
/// .introspect(.tabView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) {
18
47
/// print(type(of: $0)) // NSTabView
19
48
/// }
20
- /// #endif
21
49
/// }
22
50
/// }
23
51
/// ```
52
+ ///
24
53
public struct TabViewType : IntrospectableViewType { }
25
54
26
55
extension IntrospectableViewType where Self == TabViewType {
0 commit comments