<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/SectionedFetchRequest/init(sectionIdentifier:sortDescriptors:predicate:animation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI21SectionedFetchRequestVAASo15NSManagedObjectCRb_rlE17sectionIdentifier15sortDescriptors9predicate9animationACyxq_Gs7KeyPathCyq_xG_SaySo16NSSortDescriptorCGSo11NSPredicateCSgAA9AnimationVSgtcfc::OverloadGroup"
  },
  "title" : "init(sectionIdentifier:sortDescriptors:predicate:animation:)"
}
-->

# init(sectionIdentifier:sortDescriptors:predicate:animation:)

Creates a sectioned fetch request based on a section identifier, a
predicate, and reference type sort parameters.

```
@MainActor @preconcurrency init(sectionIdentifier: KeyPath<Result, SectionIdentifier>, sortDescriptors: [NSSortDescriptor], predicate: NSPredicate? = nil, animation: Animation? = nil)
```

## Parameters

`sectionIdentifier`

A key path that SwiftUI applies to the `Result`
type to get an object’s section identifier.

`sortDescriptors`

An array of sort descriptors that define the sort
order of the fetched results.

`predicate`

An
<doc://com.apple.documentation/documentation/Foundation/NSPredicate>
instance that defines logical conditions used to filter the fetched
results.

`animation`

The animation to use for user interface changes that
result from changes to the fetched results.

## Discussion

The request gets the entity type from the `Result` instance by calling
that managed object’s
<doc://com.apple.documentation/documentation/CoreData/NSManagedObject/entity()>
type method. If you need to specify the entity type explicitly, use the
[`init(entity:sectionIdentifier:sortDescriptors:predicate:animation:)`](/documentation/SwiftUI/SectionedFetchRequest/init(entity:sectionIdentifier:sortDescriptors:predicate:animation:))
initializer instead. If you need more control over the fetch request
configuration, use [`init(fetchRequest:sectionIdentifier:animation:)`](/documentation/SwiftUI/SectionedFetchRequest/init(fetchRequest:sectionIdentifier:animation:)).
For value type sort descriptors, use
[`init(sectionIdentifier:sortDescriptors:predicate:animation:)`](/documentation/SwiftUI/SectionedFetchRequest/init(sectionIdentifier:sortDescriptors:predicate:animation:)).

---

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)