---
title: "class(forFileType:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsimagerep/class(forfiletype:)"
---

# class(forFileType:)

Returns the image representation subclass that handles data with the specified type.

## Declaration

```swift
class func `class`(forFileType type: String) -> AnyClass?
```

## Parameters

- `type`: A string containing the filename extension or an encoded HFS type.

## Return Value

Return Value A Class object for the image representation that can handle the type of data, or nil if no image representation could handle the type.

## See Also

### Managing Representation Subclasses of Images

- [class(forType:)](appkit/nsimagerep/class(fortype:).md)
- [class(for:)](appkit/nsimagerep/class(for:).md)
- [registeredClasses](appkit/nsimagerep/registeredclasses.md)
- [registerClass(_:)](appkit/nsimagerep/registerclass(_:).md)
- [unregisterClass(_:)](appkit/nsimagerep/unregisterclass(_:).md)
- [class(forPasteboardType:)](appkit/nsimagerep/class(forpasteboardtype:).md)
