<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/QueryResult/Iterator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation11QueryResultV8IteratorV"
  },
  "title" : "QueryResult.Iterator"
}
-->

# QueryResult.Iterator

The type of iterator used for entity query results.

```
struct Iterator
```

## Topics

### Advancing the iterator

[`func next() -> Element?`](/documentation/RealityKit/QueryResult/Iterator/next())

Advances to the next entity and returns it.

## Relationships

### Conforms To

[`IteratorProtocol`](/documentation/Swift/IteratorProtocol)

---

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)