Skip to content

Commit e86a27c

Browse files
committed
wip
1 parent 80b9581 commit e86a27c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Sources/ViewTypes/ToggleWithSwitchStyle.swift

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,38 @@ import SwiftUI
22

33
/// An abstract representation of the `Toggle` type in SwiftUI, with `.switch` style.
44
///
5+
/// ### iOS
6+
///
57
/// ```swift
68
/// struct ContentView: View {
79
/// @State var isOn = false
810
///
911
/// var body: some View {
1012
/// Toggle("Switch", isOn: $isOn)
1113
/// .toggleStyle(.switch)
12-
/// #if os(iOS)
1314
/// .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
1415
/// print(type(of: $0)) // UISwitch
1516
/// }
16-
/// #elseif os(macOS)
17+
/// }
18+
/// }
19+
/// ```
20+
///
21+
/// ### tvOS
22+
///
23+
/// Not available.
24+
///
25+
/// ### macOS
26+
///
27+
/// ```swift
28+
/// struct ContentView: View {
29+
/// @State var isOn = false
30+
///
31+
/// var body: some View {
32+
/// Toggle("Switch", isOn: $isOn)
33+
/// .toggleStyle(.switch)
1734
/// .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) {
1835
/// print(type(of: $0)) // NSSwitch
1936
/// }
20-
/// #endif
2137
/// }
2238
/// }
2339
/// ```

0 commit comments

Comments
 (0)