<!--
{
  "availability" : [
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "TVMLKit",
  "identifier" : "/documentation/TVMLKit/TVElementFactory/registerViewElementClass(_:elementName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "TVMLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TVElementFactory(cm)registerViewElementClass:forElementName:"
  },
  "title" : "registerViewElementClass(_:elementName:)"
}
-->

# registerViewElementClass(_:elementName:)

Registers a view element for the specified element name.

```
class func registerViewElementClass(_ elementClass: AnyClass, elementName: String)
```

## Parameters

`elementClass`

The class of the element.

`elementName`

The element name used when referencing this element within TVML.

## Discussion

The [`TVViewElement`](/documentation/TVMLKit/TVViewElement) class represents a read-only DOM node along with its attributes and aggregated style. This model object is traversed by the interface factory to construct views and view controllers, and to render templates. You must call this method for each element you register.

---

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)