another.im-ios/AnotherIM/Helpers/URL+Extensions.swift
2024-10-31 12:43:16 +01:00

14 lines
338 B
Swift

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"
}
}
}