---
title: "component(ofType:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkentity/component(oftype:)"
---

# component(ofType:)

## Declaration

```swift
func component<ComponentType>(ofType componentClass: ComponentType.Type) -> ComponentType? where ComponentType : GKComponent
```

## See Also

### Instance Methods

- [removeComponent(ofType:)](gameplaykit/gkentity/removecomponent(oftype:).md)
