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

# class(for:)

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

## Declaration

```swift
class func `class`(for data: Data) -> AnyClass?
```

## Parameters

- `data`: The image data.

## Return Value

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

## See Also

### Managing Representation Subclasses of Images

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