Skip to content

Commit 6fb482e

Browse files
committed
WIP
1 parent 6362dff commit 6fb482e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Sources/ViewTypes/ToggleWithButtonStyle.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
///
1010
/// Not available.
1111
///
12-
/// ### macOS
12+
/// ### macOS 10.15 - 15
13+
///
14+
/// Note: toggles with button style on macOS 26+ and later no longer use `NSButton` under the hood, so introspection
15+
/// is not possible.
1316
///
1417
/// ```swift
1518
/// struct ContentView: View {
@@ -18,7 +21,7 @@
1821
/// var body: some View {
1922
/// Toggle("Toggle", isOn: $isOn)
2023
/// .toggleStyle(.button)
21-
/// .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26)) {
24+
/// .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15)) {
2225
/// print(type(of: $0)) // NSButton
2326
/// }
2427
/// }
@@ -51,7 +54,8 @@ extension macOSViewVersion<ToggleWithButtonStyleType, NSButton> {
5154
public static let v13 = Self(for: .v13)
5255
public static let v14 = Self(for: .v14)
5356
public static let v15 = Self(for: .v15)
54-
public static let v26 = Self(for: .v26)
57+
@available(*, unavailable, message: ".toggleStyle(.button) isn't available on macOS 26")
58+
public static let v26 = Self.unavailable
5559
}
5660
#endif
5761
#endif

0 commit comments

Comments
 (0)