Where's the iPhone MIME type database?
If it did, your app surely wouldn't have permissions to even read it directly. What are you trying to do?
EDIT
This is a function I wrote a while ago. I wrote it for the Mac, but it looks like the same functions exist on the iPhone. Basically, you give it a filename, and it uses the path extension to return the file's MIME type:
#import <MobileCoreServices/MobileCoreServices.h>
...
- (NSString*) fileMIMEType:(NSString*) file {
CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)[file pathExtension], NULL);
CFStringRef MIMEType = UTTypeCopyPreferredTagWithClass (UTI, kUTTagClassMIMEType);
CFRelease(UTI);
return [(NSString *)MIMEType autorelease];
}
The following function will return the mime-type for a given file extension in Swift 2
import MobileCoreServices
func mimeTypeFromFileExtension(fileExtension: String) -> String? {
guard let uti: CFString = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileExtension as NSString, nil)?.takeRetainedValue() else {
return nil
}
guard let mimeType: CFString = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() else {
return nil
}
return mimeType as String
}