---
title: ResultsSection
framework: swiftdata
role: symbol
role_heading: Structure
path: swiftdata/resultssection
---

# ResultsSection

A section of fetched results grouped by a common section key path value.

## Declaration

```swift
struct ResultsSection<Element, SectionName> where Element : PersistentModel, SectionName : Hashable
```

## Overview

Overview Each section represents a group of elements that share the same value for the sectionBy key path used at creation. You access sections through sections or Query.sections. Each section conforms to RandomAccessCollection — iterate it directly to access its elements, and use name (or id) to access the section identifier.

## Topics

### Accessing section properties

- [id](swiftdata/resultssection/id.md)
- [name](swiftdata/resultssection/name.md)

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Identifiable](swift/identifiable.md)
- [RandomAccessCollection](swift/randomaccesscollection.md)
- [Sequence](swift/sequence.md)

## See Also

### Retrieving sections

- [subscript(sectionName:)](swiftdata/resultssectioncollection/subscript(sectionname:).md)
