Creates a uniform type identifier for the type indicated by the specified tag.


func UTTypeCreatePreferredIdentifierForTag(_ inTagClass: CFString, _ inTag: CFString, _ inConformingToUTI: CFString?) -> Unmanaged<CFString>?



The class of the inTag parameter. For more information, see Type Tag Classes.


The tag to translate into a uniform type identifier.


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


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.

See Also

Creating Uniform Type Identifiers

func UTTypeCreateAllIdentifiersForTag(CFString, CFString, CFString?) -> Unmanaged<CFArray>?

Creates an array of all uniform type identifiers for the type indicated by the specified tag.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software