Skip to content

Commit 095002f

Browse files
committed
wip
1 parent 93b8ec6 commit 095002f

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Sources/ViewTypes/ToggleWithButtonStyle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SwiftUI
55
/// ```swift
66
/// struct ContentView: View {
77
/// @State var isOn = false
8-
///
8+
///
99
/// var body: some View {
1010
/// Toggle("Toggle", isOn: $isOn)
1111
/// .toggleStyle(.button)

Sources/ViewTypes/ToggleWithCheckboxStyle.swift

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
import SwiftUI
22

3-
// MARK: SwiftUI.Toggle(...).toggleStyle(.checkbox)
4-
3+
/// An abstract representation of the `Toggle` type in SwiftUI, with `.checkbox` style.
4+
///
5+
/// ```swift
6+
/// struct ContentView: View {
7+
/// @State var isOn = false
8+
///
9+
/// var body: some View {
10+
/// Toggle("Checkbox", isOn: $isOn)
11+
/// .toggleStyle(.checkbox)
12+
/// #if os(macOS)
13+
/// .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) {
14+
/// print(type(of: $0)) // NSButton
15+
/// }
16+
/// #endif
17+
/// }
18+
/// }
19+
/// ```
520
public struct ToggleWithCheckboxStyleType: IntrospectableViewType {
621
public enum Style {
722
case checkbox

0 commit comments

Comments
 (0)