<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKComponentSystem/addComponent(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKComponentSystem(im)addComponent:"
  },
  "title" : "addComponent(_:)"
}
-->

# addComponent(_:)

Adds a component instance to the component system.

```
func addComponent(_ component: ComponentType)
```

## Parameters

`component`

An instance of a [`GKComponent`](/documentation/GameplayKit/GKComponent) subclass.

## Discussion

The component instance must be of the same [`GKComponent`](/documentation/GameplayKit/GKComponent) subclass specified by the [`componentClass`](/documentation/GameplayKit/GKComponentSystem/componentClass) property.

---

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)