---
title: "has(_:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/querypredicate/has(_:)"
---

# has(_:)

Creates a new predicate that describes entities that have a specific component.

## Declaration

```swift
static func has<T>(_ t: T.Type) -> QueryPredicate<Entity> where T : Component
```

## Parameters

- `t`: The type of component.

## Return Value

Return Value A predicate that describes entities with a specified component.

## Discussion

Discussion To create a has predicate, pass the component class’s self property. let myPredicate = QueryPredicate.has(ModelComponent.self)
