<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextAttachment/registerViewProviderClass(_:forFileType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextAttachment(cm)registerTextAttachmentViewProviderClass:forFileType:"
  },
  "title" : "registerViewProviderClass(_:forFileType:)"
}
-->

# registerViewProviderClass(_:forFileType:)

Registers a specific file type with the attachment view provider.

```
class func registerViewProviderClass(_ textAttachmentViewProviderClass: AnyClass, forFileType fileType: String)
```

## Parameters

`textAttachmentViewProviderClass`

The text attachment view provider class.

`fileType`

A <doc://com.apple.documentation/documentation/Swift/String> that represents the file type.

## Discussion

---

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)