Skip to content

Commit 54e0fcc

Browse files
committed
wip
1 parent 27ac014 commit 54e0fcc

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Sources/ViewTypes/Toggle.swift

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,40 @@ import SwiftUI
22

33
/// An abstract representation of the `Toggle` type in SwiftUI.
44
///
5+
/// ### iOS
6+
///
57
/// ```swift
68
/// struct ContentView: View {
79
/// @State var isOn = false
8-
///
10+
///
911
/// var body: some View {
1012
/// Toggle("Toggle", isOn: $isOn)
11-
/// #if os(iOS)
1213
/// .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
1314
/// print(type(of: $0)) // UISwitch
1415
/// }
15-
/// #elseif os(macOS)
16+
/// }
17+
/// }
18+
/// ```
19+
///
20+
/// ### tvOS
21+
///
22+
/// Not available.
23+
///
24+
/// ### macOS
25+
///
26+
/// ```swift
27+
/// struct ContentView: View {
28+
/// @State var isOn = false
29+
///
30+
/// var body: some View {
31+
/// Toggle("Toggle", isOn: $isOn)
1632
/// .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) {
1733
/// print(type(of: $0)) // NSButton
1834
/// }
19-
/// #endif
2035
/// }
2136
/// }
2237
/// ```
38+
///
2339
public struct ToggleType: IntrospectableViewType {}
2440

2541
#if !os(tvOS)

0 commit comments

Comments
 (0)