init(mimeType:conformingTo:)
Creates a type based on a MIME type and a supertype that it conforms to.
Declaration
init?(mimeType: String, conformingTo supertype: UTType = .data)Parameters
- mimeType:
A string that represents the MIME type.
- supertype:
Another Uttype Swift.struct instance that the resulting type must conform to; for example, Uttypedata.
Discussion
This initializer is equivalent to calling:
UTType(tag: mimeType,
tagClass: .mimeType,
conformingTo: supertype)The initializer may provide a dynamic type if the parameters are valid, but the system doesn’t find any types with the MIME type and conformance. The initializer returns nil if the parameters aren’t valid.