---
title: "addComponent(foundIn:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkcomponentsystem/addcomponent(foundin:)"
---

# addComponent(foundIn:)

Adds any instances of the component system’s component class in the specified entity to the component system.

## Declaration

```swift
func addComponent(foundIn entity: GKEntity)
```

## Parameters

- `entity`: An entity.

## Discussion

Discussion This method examines the components array of the specified entity, adding any components whose type matches the component system’s componentClass property to the component system.

## See Also

### Managing a List of Components

- [componentClass](gameplaykit/gkcomponentsystem/componentclass.md)
- [components](gameplaykit/gkcomponentsystem/components.md)
- [addComponent(_:)](gameplaykit/gkcomponentsystem/addcomponent(_:).md)
- [removeComponent(_:)](gameplaykit/gkcomponentsystem/removecomponent(_:).md)
- [removeComponent(foundIn:)](gameplaykit/gkcomponentsystem/removecomponent(foundin:).md)
