Skip to content

Commit 88ca61e

Browse files
committed
Respell available clause and link to forums
1 parent be20ead commit 88ca61e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sources/UIKitBackend/KeyboardToolbar.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ extension Button: ToolbarItem {
9393
}
9494
}
9595

96-
@available(iOS 14, macCatalyst 14, tvOS 14, *)
97-
@available(tvOS, unavailable)
96+
// Despite the fact that this is unavailable on tvOS, the `introduced: 14`
97+
// clause is required for all current Swift versions to accept it.
98+
// See https://forums.swift.org/t/contradictory-available-s-are-required/78831
99+
@available(iOS 14, macCatalyst 14, *)
100+
@available(tvOS, unavailable, introduced: 14)
98101
extension Spacer: ToolbarItem {
99102
public func createBarButtonItem() -> UIBarButtonItem {
100103
if let minLength, minLength > 0 {
@@ -136,8 +139,8 @@ struct FixedWidthToolbarItem<Base: ToolbarItem>: ToolbarItem {
136139
}
137140

138141
// Setting width on a flexible space is ignored, you must use a fixed space from the outset
139-
@available(iOS 14, macCatalyst 14, tvOS 14, *)
140-
@available(tvOS, unavailable)
142+
@available(iOS 14, macCatalyst 14, *)
143+
@available(tvOS, unavailable, introduced: 14)
141144
struct FixedWidthSpacerItem: ToolbarItem {
142145
var width: Int?
143146

0 commit comments

Comments
 (0)