For some reason the UTIDescription I get through my Swift project differs from Finder's 'Get Info` file kind field for a number of files.
For example below you can see on the left, the UTIDescription I get is quite lengthy and the on the right provided by Finder is short and makes sense ⤵︎
Below is the code I use to get the UTIDescription
of a targeted file
...
// Grab the extension and unique type identifier
itemExtension = NSURL(fileURLWithPath: path!).pathExtension!
let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension as CFString, itemExtension as CFString, nil)?.takeRetainedValue()
// Determines if the uti conforms
func doesConform(kUTType: CFString) -> Bool {
return UTTypeConformsTo(uti!, kUTType)
}
// Gets the item's UTI description
func getUTIDescription() -> String? {
if UTTypeCopyDescription(uti!)?.takeRetainedValue() != nil {
return UTTypeCopyDescription(uti!)!.takeRetainedValue() as String
} else {
return nil
}
}
. . .
Is the conflict just a result from custom UTIDescription's in Finder or am I grabbing the wrong property here?