UTType Reference
| Framework | /System/Library/Frameworks/MobileCoreServices.framework |
| Companion guide | |
| Declared in | UTCoreTypes.h UTType.h |
Overview
Uniform Type Identifiers (or UTIs) are strings which uniquely identify abstract types. They can be used to describe a file format or an in-memory data type, but can also be used to describe the type of other sorts of entities, such as directories, volumes, or packages.
Type declarations appear in bundle property lists and tell the system several things about a type. Detailed information about the format and declaration of a UTI can be found in Uniform Type Identifiers Overview. A few key concepts that are found in the declaration include:
Conformance. Conformance relationships establish a multiple inheritance hierarchy between types. Type property values may be inherited at runtime according to the conformance relationships for each type. When a type's declaration does not include a value for particular type property, then the type's supertypes are searched for a value. Supertypes are searched depth-first, in the order given in the type declaration. This is the only way in which the declared order of the supertypes is significant.
Tags. A tag is a string which indicates the definition of the type in some other type identification mechanism, such as a filename extension or MIME type. The namespace of the other type identification mechanism is known as its class. Classes are themselves identified by uniform type identifiers so that the set of valid tag classes is easily extended in the future.
Type declarations may include several other properties: a localizable user description of the type, the name of an icon resource in the declaring bundle, a reference URL identifying technical documentation about the type itself, and a version number, which can be incremented as a type evolves. All of these properties are optional.
Functions by Task
Creating Uniform Type Identifiers
Obtaining Tags from Uniform Type Identifiers
Testing Uniform Type Identifiers
Obtaining Additional Type Information
Functions
UTTypeConformsTo
Returns whether a uniform type identifier conforms to another uniform type identifier.
Boolean UTTypeConformsTo( CFStringRef inUTI, CFStringRef inConformsToUTI);
Parameters
- inUTI
A uniform type identifier to compare.
- inConformsToUTI
The uniform type identifier to compare it to.
Return Value
Returns true if the uniform type identifier is equal to or conforms to the second type.
Availability
- Available in iOS 3.0 and later.
Declared In
UTType.hUTTypeCopyDeclaration
Returns a uniform type’s declaration.
CFDictionaryRef UTTypeCopyDeclaration(CFStringRef inUTI);
Parameters
- inUTI
A uniform type identifier.
Return Value
A dictionary that contains the uniform type’s declaration, or NULL if no declaration for that type can be found.
Discussion
A uniform type identifier is declared in a bundle’s information property list (info.plist). This function extracts and returns a dictionary that contains the complete declaration of the uniform type identifier. This is useful when your application needs to access properties that does not have a built-in accessor function. For more information on the dictionary format, see Uniform Type Identifiers Overview.
Availability
- Available in iOS 3.0 and later.
Declared In
UTType.hUTTypeCopyDeclaringBundleURL
Returns the location of a bundle containing the declaration for a type.
CFURLRef UTTypeCopyDeclaringBundleURL(CFStringRef inUTI);
Parameters
- inUTI
A uniform type identifier.
Return Value
A URL that points to the bundle that holds the uniform type identifier’s declaration, or NULL if a bundle that holds the declaration cannot be located.
Availability
- Available in iOS 3.0 and later.
Declared In
UTType.hUTTypeCopyDescription
Returns the localized, user-readable type description string associated with a uniform type identifier.
CFStringRef UTTypeCopyDescription(CFStringRef inUTI);
Parameters
- inUTI
A uniform type identifier.
Return Value
A localized string describing the type, or NULL if no type description is available.
Discussion
The localized string that describes the uniform type is found in the type’s declaration.
Availability
- Available in iOS 3.0 and later.
Declared In
UTType.hUTTypeCopyPreferredTagWithClass
Translates a uniform type identifier to a list of tags in a different type classification method.
CFStringRef UTTypeCopyPreferredTagWithClass( CFStringRef inUTI, CFStringRef inTagClass);
Parameters
- inUTI
The uniform type identifier to convert.
- inTagClass
The class of the tags you want to return. For more information, see
“Type Tag Classes”.
Return Value
An array of tags (as CFStrings), or NULL if there was no translation available to convert the uniform type identifier to the specified class.
Discussion
If the type declaration included more than one tag with the specified class, the first tag in the declared tag array is the preferred tag.
Availability
- Available in iOS 3.0 and later.
Declared In
UTType.hUTTypeCreateAllIdentifiersForTag
Creates an array of all uniform type identifiers for the type indicated by the specified tag.
CFArrayRef UTTypeCreateAllIdentifiersForTag( CFStringRef inTagClass, CFStringRef inTag, CFStringRef inConformingToUTI);
Parameters
- inTagClass
The class of the inTag parameter. For more information, see
“Type Tag Classes”.- inTag
The tag to translate into a uniform type identifier.
- inConformingToUTI
If not
nil, all returned uniform type identifiers must conform to this parameter.
Return Value
An array of uniform type identifiers, or NULL if inTagClass is not a known tag class
Discussion
This function is used to translate a type declared using another declaration mechanism (for example, MIME types) into a uniform type identifier. This function searches all UTI declarations for a matching translation and returns all possible results. If a conforming parameter is assigned, the search is reduced to the subset of type identifiers that conform to that type.
If no result is found, this function creates a dynamic type beginning with the dyn prefix.
Availability
- Available in iOS 3.0 and later.
See Also
Declared In
UTType.hUTTypeCreatePreferredIdentifierForTag
Creates a uniform type identifier for the type indicated by the specified tag.
CFStringRef UTTypeCreatePreferredIdentifierForTag( CFStringRef inTagClass, CFStringRef inTag, CFStringRef inConformingToUTI);
Parameters
- inTagClass
The class of the inTag parameter. For more information, see
“Type Tag Classes”.- inTag
The tag to translate into a uniform type identifier.
- inConformingToUTI
If not
NULL, the returned uniform type identifier must conform to this parameter.
Return Value
A new CFStringRef containing a uniform type identifier, or NULL if inTagClass is not a known tag class
Discussion
This function is used to translate a type declared using another declaration mechanism (for example, MIME types) into a uniform type identifier. This function searches all UTI declarations for a matching translation. If a conforming parameter is assigned, the search is reduced to the subset of type identifiers that conform to that type.
If there is more than one possible UTI for the specified tag, the UTI that will be returned is undefined. See UTTypeCreateAllIdentifiersForTag if you need to see all search results.
If no result is found, this function creates a dynamic type beginning with the dyn prefix. This allows you to pass the UTI around and convert it back to the original tag.
Availability
- Available in iOS 3.0 and later.
See Also
Declared In
UTType.hUTTypeEqual
Returns whether two uniform type identifiers are equal.
Boolean UTTypeEqual( CFStringRef inUTI1, CFStringRef inUTI2);
Parameters
- inUTI1
A uniform type identifier.
- inUTI2
The uniform type identifier to compare it to.
Return Value
Returns true if the two uniform type identifiers are equivalent.
Discussion
If one or both of the identifiers is a dynamic identifier, then the types are equal if either identifier's tag specification is a subset of the other identifier's tag specification.
Availability
- Available in iOS 3.0 and later.
Declared In
UTType.hConstants
Type Declaration Dictionary Keys
These are keys for values found in a UTI dictionary. For more information about UTI dictionaries, see Uniform Type Identifiers Overview.
const CFStringRef kUTExportedTypeDeclarationsKey; const CFStringRef kUTImportedTypeDeclarationsKey; const CFStringRef kUTTypeIdentifierKey; const CFStringRef kUTTypeTagSpecificationKey; const CFStringRef kUTTypeConformsToKey; const CFStringRef kUTTypeDescriptionKey; const CFStringRef kUTTypeIconFileKey; const CFStringRef kUTTypeReferenceURLKey; const CFStringRef kUTTypeVersionKey;
Constants
kUTExportedTypeDeclarationsKeyAn array of exported UTI declarations.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTImportedTypeDeclarationsKeyAn array of imported UTI declarations.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeIdentifierKeyThe uniform type identifier for the declared type. This key is required.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeTagSpecificationKeyA dictionary containing conversions of the uniform type identifier to equivalent tags in other classification schemes. See “Type Tag Classes” for examples.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeConformsToKeyThe UTIs to which this identifier conforms.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeDescriptionKeyA user-visible description of this type (may be localized).
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeIconFileKeyThe name of the bundle icon resource to associate with this UTI.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeReferenceURLKeyThe URL of a reference document describing this type.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTypeVersionKeyA version string.
Available in iOS 3.0 and later.
Declared in
UTType.h.
Type Tag Classes
These strings identify other tagging classification schemes that a uniform type identifier can be converted to and from.
const CFStringRef kUTTagClassFilenameExtension; const CFStringRef kUTTagClassMIMEType;
Constants
kUTTagClassFilenameExtensionIndicates that the tag is a filename extension.
Available in iOS 3.0 and later.
Declared in
UTType.h.kUTTagClassMIMETypeIndicates that the tag is a MIME type.
Available in iOS 3.0 and later.
Declared in
UTType.h.
UTI Abstract Types
These are abstract uniform type identifiers that most other type identifiers are derived from.
const CFStringRef kUTTypeItem; const CFStringRef kUTTypeContent; const CFStringRef kUTTypeCompositeContent; const CFStringRef kUTTypeApplication; const CFStringRef kUTTypeMessage; const CFStringRef kUTTypeContact; const CFStringRef kUTTypeArchive; const CFStringRef kUTTypeDiskImage;
Constants
kUTTypeItemThe generic abstract type identifier for most things (files, directories).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeContentThe abstract type identifier for anything containing user-viewable document content (documents, pasteboard data, and document packages).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeCompositeContentThe abstract type identifier for content formats supporting mixed embedded content (i.e., compound documents).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeApplicationThe type identifier for Mac apps.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMessageThe abstract type identifier for messages (email, instant message, etc.).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeContactThe abstract type identifier for contact information( for example, a person, group, or organization).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeArchiveThe abstract type identifier for an archive of files and directories.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeDiskImageThe type identifier for a data item mountable as a volume.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Concrete Types
These are uniform type identifiers for concrete types.
const CFStringRef kUTTypeData; const CFStringRef kUTTypeDirectory; const CFStringRef kUTTypeResolvable; const CFStringRef kUTTypeSymLink; const CFStringRef kUTTypeMountPoint; const CFStringRef kUTTypeAliasFile; const CFStringRef kUTTypeAliasRecord; const CFStringRef kUTTypeURL; const CFStringRef kUTTypeFileURL;
Constants
kUTTypeDataThe type identifier for any sort of simple byte stream, including files and in-memory data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeDirectoryThe type identifier for a file system directory, including packages and folders.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeResolvableThe type identifier for symbolic links and alias files.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeSymLinkThe type identifier for a symbolic link.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMountPointThe type identifier for a root directory of a volume.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeAliasFileThe type identifier for a fully-formed alias file.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeAliasRecordThe type identifier for raw alias data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeURLThe type identifier for the bytes of a URL.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeFileURLThe type identifier for the text of a "file:" URL.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Text Types
These are the uniform type identifiers for text content.
const CFStringRef kUTTypeText; const CFStringRef kUTTypePlainText; const CFStringRef kUTTypeUTF8PlainText; const CFStringRef kUTTypeUTF16ExternalPlainText; const CFStringRef kUTTypeUTF16PlainText; const CFStringRef kUTTypeRTF; const CFStringRef kUTTypeHTML; const CFStringRef kUTTypeXML; const CFStringRef kUTTypeSourceCode; const CFStringRef kUTTypeCSource; const CFStringRef kUTTypeObjectiveCSource; const CFStringRef kUTTypeCPlusPlusSource; const CFStringRef kUTTypeObjectiveCPlusPlusSource; const CFStringRef kUTTypeCHeader; const CFStringRef kUTTypeCPlusPlusHeader; const CFStringRef kUTTypeJavaSource;
Constants
kUTTypeTextThe type identifier for all text-encoded data, including text with markup (HTML, RTF, etc.).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypePlainTextThe type identifier for text with no markup and in an unspecified encoding.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeUTF8PlainTextThe type identifier for plain text in a UTF-8 encoding.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeUTF16ExternalPlainTextThe type identifier for plain text in a UTF-16 encoding. If the encoded text does not include a byte order mark (BOM), the data has "external representation" byte order (big-endian).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeUTF16PlainTextThe type identifier for plain text in a UTF-16 encoding in native byte order. The byte order mark (BOM) is optional. Correspondes to the 'utxt' OSType.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeRTFThe type identifier for Rich Text Format.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeHTMLThe type identifier for HTML, any version.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeXMLThe type identifier for XML data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeSourceCodeThe abstract type identifier for source code (any language).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeCSourceThe type identifier for C source code (.c).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeObjectiveCSourceThe type identifier for Objective-C source code (.m).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeCPlusPlusSourceThe type identifier for C++ source code (.cp, etc.).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeObjectiveCPlusPlusSourceThe type identifier for Objective-C++ source code.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeCHeaderThe type identifier for a C header.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeCPlusPlusHeaderThe type identifier for a C++ header.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeJavaSourceThe type identifier for Java source code.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Composite Content Types
Uniform type identifiers for content that includes multiple data types.
const CFStringRef kUTTypePDF; const CFStringRef kUTTypeRTFD; const CFStringRef kUTTypeFlatRTFD; const CFStringRef kUTTypeTXNTextAndMultimediaData; const CFStringRef kUTTypeWebArchive;
Constants
kUTTypePDFThe type identifier for Adobe PDF format.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeRTFDThe type identifier for Rich Text Format Directory (RTF with content embedding, on-disk format).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeFlatRTFDThe type identifier for Flattened RTFD (pasteboard format).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeTXNTextAndMultimediaDataThe type identifier for MLTE (Textension) format for mixed text and multimedia data. Corresponds to the 'txtn' OSType.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeWebArchiveThe type identifier for the WebKit web archive format
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Image Content Types
Uniform type identifiers for graphics content.
const CFStringRef kUTTypeImage; const CFStringRef kUTTypeJPEG; const CFStringRef kUTTypeJPEG2000; const CFStringRef kUTTypeTIFF; const CFStringRef kUTTypePICT; const CFStringRef kUTTypeGIF; const CFStringRef kUTTypePNG; const CFStringRef kUTTypeQuickTimeImage; const CFStringRef kUTTypeAppleICNS const CFStringRef kUTTypeBMP; const CFStringRef kUTTypeICO;
Constants
kUTTypeImageThe abstract type identifier for image data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeJPEGThe type identifier for a JPEG image.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeJPEG2000The type identifier for a JPEG-2000 image.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeTIFFThe type identifier for a TIFF image.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypePICTThe type identifier for a Quickdraw PICT.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeGIFThe type identifier for a GIF image.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypePNGThe type identifier for a PNG image.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeQuickTimeImageThe type identifier for a QuickTime image. Corresponds to the 'qtif' OSType.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeAppleICNSThe type identifier for Apple icon data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeBMPThe type identifier for a Windows bitmap.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeICOThe type identifier for Windows icon data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Audio Visual Content Types
Uniform type identifier for audio and video content.
const CFStringRef kUTTypeAudiovisualContent; const CFStringRef kUTTypeMovie; const CFStringRef kUTTypeVideo; const CFStringRef kUTTypeAudio; const CFStringRef kUTTypeQuickTimeMovie; const CFStringRef kUTTypeMPEG; const CFStringRef kUTTypeMPEG4; const CFStringRef kUTTypeMP3; const CFStringRef kUTTypeMPEG4Audio; const CFStringRef kUTTypeAppleProtectedMPEG4Audio;
Constants
kUTTypeAudiovisualContentAn abstract type identifier for audio and/or video content.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMovieAn abstract type identifier for a media format which may contain both video and audio. Corresponds to what users would label a "movie"
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeVideoAn abstract type identifier for pure video data(no audio).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeAudioAn abstract type identifier for pure audio data (no video).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeQuickTimeMovieThe type identifier for a QuickTime movie.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMPEGThe type identifier for a MPEG-1 or MPEG-2 movie.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMPEG4The type identifier for a MPEG-4 movie.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMP3The type identifier for MP3 audio.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeMPEG4AudioThe type identifier for a MPEG-4 audio layer (.m4a, or the MIME type audio/MP4).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeAppleProtectedMPEG4AudioThe type identifier for Apple protected MPEG4 format (.m4p, iTunes music store format).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Directory Types
Uniform type identifiers for different directory types.
const CFStringRef kUTTypeFolder; const CFStringRef kUTTypeVolume; const CFStringRef kUTTypePackage; const CFStringRef kUTTypeBundle; const CFStringRef kUTTypeFramework;
Constants
kUTTypeFolderThe type identifier for a a user-browsable directory (i.e., not a package).
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeVolumeThe type identifier for the root folder of a volume/mount point.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypePackageThe type identifier for a packaged directory.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeBundleThe type identifier for a directory conforming to a
CFBundlelayout.Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeFrameworkThe type identifier for directory conforming to an OS X framework.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Application Types
Uniform type identifiers for application types.
const CFStringRef kUTTypeApplicationBundle; const CFStringRef kUTTypeApplicationFile;
Constants
kUTTypeApplicationBundleThe type identifier for a bundled application.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.kUTTypeApplicationFileThe type identifier for a single-file Carbon/Classic application.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Contact Types
Uniform type identifiers for contact types.
const CFStringRef kUTTypeVCard;
Constants
kUTTypeVCardThe type identifier for VCard format.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
UTI Miscellaneous Types
Uniform type identifiers for types that do not fit in other categories.
const CFStringRef kUTTypeInkText;
Constants
kUTTypeInkTextThe type identifier for Opaque InkText data.
Available in iOS 3.0 and later.
Declared in
UTCoreTypes.h.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-09-01)