Skip to content

Commit 93b8ec6

Browse files
committed
wip
1 parent 2234d09 commit 93b8ec6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

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

0 commit comments

Comments
 (0)