<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSSearchableItemAttributeSet/init(contentType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSSearchableItemAttributeSet(im)initWithContentType:"
  },
  "title" : "init(contentType:)"
}
-->

# init(contentType:)

Creates an attribute set for the specified content type.

```
init(contentType: UTType)
```

## Parameters

`contentType`

The type of the content. For example, <doc://com.apple.documentation/documentation/UniformTypeIdentifiers/UTType-swift.struct/png> or <doc://com.apple.documentation/documentation/UniformTypeIdentifiers/UTType-swift.struct/movie>.

## Return Value

An attribute set that represents an item of the specified content type.

---

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)