Skip to content

Commit 4add0ab

Browse files
committed
wip
1 parent 0258cf3 commit 4add0ab

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

Sources/ViewTypes/TabView.swift

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,54 @@ import SwiftUI
22

33
/// An abstract representation of the `TabView` type in SwiftUI.
44
///
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+
///
523
/// ```swift
624
/// struct ContentView: View {
725
/// var body: some View {
826
/// TabView {
927
/// Text("Tab 1").tabItem { Text("Tab 1") }
1028
/// Text("Tab 2").tabItem { Text("Tab 2") }
1129
/// }
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)) {
1431
/// print(type(of: $0)) // UITabBarController
1532
/// }
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+
/// }
1746
/// .introspect(.tabView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) {
1847
/// print(type(of: $0)) // NSTabView
1948
/// }
20-
/// #endif
2149
/// }
2250
/// }
2351
/// ```
52+
///
2453
public struct TabViewType: IntrospectableViewType {}
2554

2655
extension IntrospectableViewType where Self == TabViewType {

0 commit comments

Comments
 (0)