Post

Replies

Boosts

Views

Activity

Reply to How to sort SwiftUI Table with Data from Core Data FetchResult
This confused me based on the tutorial as adding the sortOrder seemed to make everything work. You need to make sure that the sort order is actually fed back into the data variable. Under your fetch request have a data model that changes with the sort order var tableData: [Club] { return clubs.sorted(using: sortOrder) } Then replace the table data with the above reference, like in the below. Table(tableData, selection: $selectedClubs, sortOrder: $sortOrder)
Oct ’21