One Logo Pool Ball
SwiftData · IOS API REFERENCE

ResultsSection

struct · iOS 27.0+ · SDK 27.1

struct ResultsSection<Element, SectionTitle> where Element : PersistentModel, SectionTitle : Hashable

A section of fetched results grouped by a common section key path value. Each section represents a group of elements that share the same value for the `sectionBy` key path used at creation. You access sections by iterating a ``SectionedResults`` value returned by a sectioned `@Query`. Each section conforms to `RandomAccessCollection` — iterate it directly to access its elements, and use ``title`` (or ``id``) to access the section grouping value. @Query(sort: \.name, sectionBy: \.category) var items: SectionedResults<Item, String> ForEach(items) { section in Section(section.title) { // "Work", "Personal", … ForEach(section) { item in … } // Item elements } }

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

ResultsSection.subscript(_:)

This declaration needs Swift generic type arguments. (no canonical witness for Element)

All SwiftData types →