Skip to content

Instantly share code, notes, and snippets.

@douglashill
Last active January 3, 2016 12:58
Show Gist options
  • Save douglashill/8466066 to your computer and use it in GitHub Desktop.
Save douglashill/8466066 to your computer and use it in GitHub Desktop.
Finds the best uniform type identifier (UTI) for a given filename extension
@import Foundation;
@import CoreServices;
int main(int argc, char *argv[]) {
@autoreleasepool {
NSString * UTI = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,
(CFStringRef)@"plist",
NULL);
NSLog(@"UTI is %@", UTI);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment