Use some modern APIs and fix warnings on the latest macOS SDK

This commit is contained in:
Damiano Galassi committed 2026-09-22 16:10:37 +02:00
1 parent beb7774761
commit 17c7d67b96
14 files changed
+254 -156

No files matched your search

+8 -3
View File
@@ -43,10 +43,15 @@ final class SaveOptions: NSViewController {
let types = doc.writableTypes(for: .saveAsOperation)
fileFormat.removeAllItems()
for type in types {
let name = UTTypeCopyDescription(type as CFString)?.takeRetainedValue() as String? ?? type
fileFormat.addItem(withTitle: name)
if #available(macOS 11, *) {
let name = UTType(type)?.localizedDescription ?? type
fileFormat.addItem(withTitle: name)
} else {
let name = UTTypeCopyDescription(type as CFString)?.takeRetainedValue() as String? ?? type
fileFormat.addItem(withTitle: name)
}
}
}