apple / apple/sample-cloudkit-coredatasync

Sorting not supporting Localized

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
200
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Hi, I am from Europe, Sweden. I have struggled with the FetchRequest and sorting, because the project not support localized sort order. After som research I found a solution that I wan´t to share with you.
```
@FetchRequest(
sortDescriptors: [NSSortDescriptor(key: "name", ascending: true, selector: #selector(NSString.localizedStandardCompare(_:)))],
animation: .default)
```
I would like to thanks Keith Harrison for his article "[Configuring SwiftUI Fetch Requests](https://useyourloaf.com/blog/configuring-swiftui-fetch-requests/)" and all the amazing news about SwiftUI and Dynamic Configuration in IOS 15.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.