<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UniformTypeIdentifiers",
  "identifier" : "/documentation/UniformTypeIdentifiers/UTType-swift.struct/init(mimeType:conformingTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Uniform Type Identifiers",
      "UniformTypeIdentifiers"
    ],
    "preciseIdentifier" : "s:22UniformTypeIdentifiers6UTTypeV04mimeB012conformingToACSgSS_ACtcfc"
  },
  "title" : "init(mimeType:conformingTo:)"
}
-->

# init(mimeType:conformingTo:)

Creates a type based on a MIME type and a supertype that it conforms to.

```
init?(mimeType: String, conformingTo supertype: UTType = .data)
```

## Parameters

`mimeType`

A string that represents the MIME type.

`supertype`

Another [`UTType`](/documentation/UniformTypeIdentifiers/UTType-swift.struct) instance that the resulting type must conform to; for example, [`UTTypeData`](/documentation/UniformTypeIdentifiers/UTTypeData).

## Discussion

This initializer is equivalent to calling:

```swift
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)