Adds a component to the entity.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
An instance of a
You create components by subclassing
GKEntity to implement reusable behavior. Then, use this method to incorporate the behavior of a component class into that entity.
components list never has more than one instance of any component class—if the entity already contains a component of the same class as the
component parameter, calling this method will replace that component.