another.im-ios/Monal/another.im/Helpers/URL+Extensions.swift

14 lines
338 B
Swift
Raw Normal View History

2024-11-19 16:07:47 +00:00
import UniformTypeIdentifiers
extension URL {
var mimeType: String {
let pathExtension = self.pathExtension
if let uti = UTType(filenameExtension: pathExtension) {
return uti.preferredMIMEType ?? "application/octet-stream"
} else {
return "application/octet-stream"
}
}
}