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)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
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)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How to give default value to TableColumn in Table
You could do it using the below. Table(items) { TableColumn("Name") { item in Text(item.name ?? "Default Value") } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21