sample-cloudkit-coredatasync icon indicating copy to clipboard operation
sample-cloudkit-coredatasync copied to clipboard

Sorting not supporting Localized

Open MartinAtElitappar opened this issue 3 years ago • 0 comments

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" and all the amazing news about SwiftUI and Dynamic Configuration in IOS 15.

MartinAtElitappar avatar Feb 14 '22 16:02 MartinAtElitappar