Skip to content

Commit ed1e030

Browse files
committed
Add #available for macOS
1 parent 3e6530d commit ed1e030

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Sources/AppKitBackend/AppKitBackend.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -642,19 +642,21 @@ public final class AppKitBackend: AppBackend {
642642
}
643643
textField.onSubmit = onSubmit
644644

645-
textField.contentType =
646-
switch environment.textContentType {
647-
case .url:
648-
.URL
649-
case .phoneNumber:
650-
.telephoneNumber
651-
case .name:
652-
.name
653-
case .emailAddress:
654-
.emailAddress
655-
default:
656-
nil
657-
}
645+
if #available(macOS 14, *) {
646+
textField.contentType =
647+
switch environment.textContentType {
648+
case .url:
649+
.URL
650+
case .phoneNumber:
651+
.telephoneNumber
652+
case .name:
653+
.name
654+
case .emailAddress:
655+
.emailAddress
656+
default:
657+
nil
658+
}
659+
}
658660
}
659661

660662
public func getContent(ofTextField textField: Widget) -> String {

0 commit comments

Comments
 (0)