I have a file with custom file extension created by another app (not mine). I would like to have my app in the "open with..." menu for this file but I am not able to find out correct UTI for this file extension. I understand that in macOS I can use mdls command and "kMDItemContentType" field to find out UTI but I need some method that works also for iOS.
Thank you.
What happens if you use the file extension to initialise a UTType? Like this:
import Foundation
import UniformTypeIdentifiers
let u = UTType(filenameExtension: "png")
print(u?.identifier ?? "-")
// prints: public.png
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"