<!--
{
  "availability" : [
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "TVMLKit",
  "identifier" : "/documentation/TVMLKit/TVInterfaceCreating/collectionViewCellClass(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "TVMLKit"
    ],
    "preciseIdentifier" : "c:objc(pl)TVInterfaceCreating(im)collectionViewCellClassForElement:"
  },
  "title" : "collectionViewCellClass(for:)"
}
-->

# collectionViewCellClass(for:)

Returns a collection view cell for the specified element.

```
optional func collectionViewCellClass(for element: TVViewElement) -> AnyClass?
```

## Parameters

`element`

The element a collection view cell is created for.

## Return Value

The new collection view cell associated with the given element name.

## Discussion

The collection view cell must be in a list, shelf, or grid. This method is called once per unique element name as a common cell class is used for all elements that share the same name in a collection. Return `nil` for default handling.

---

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)