macos: disable macOS-only API on iOS

This commit is contained in:
Mitchell Hashimoto
2024-06-30 19:03:06 -07:00
parent f0737356cb
commit 1d70e822c5

View File

@ -7,6 +7,7 @@ extension String {
return self.prefix(maxLength) + trailing
}
#if canImport(AppKit)
func temporaryFile(_ filename: String = "temp") -> URL {
let url = FileManager.default.temporaryDirectory
.appendingPathComponent(filename)
@ -15,4 +16,5 @@ extension String {
try? string.write(to: url, atomically: true, encoding: .utf8)
return url
}
#endif
}