Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
2 answers
883 views

SwiftData sorting order of Query array elements

I have a simple test app with a behavior I just don't understand. import SwiftUI import SwiftData struct ContentView: View { @Environment(\.modelContext) private var modelContext @Query ...
Torsten's user avatar
  • 25
4 votes
1 answer
848 views

Sort SwiftData Query shown in SwiftUI Table on macOS

I have a mini macOS app, presenting some data persisted in SwiftData on a Table. I want to sort the data by clicking on Table's column headers so I have a KeyPathComparator on the table. But since the ...
Arda Oğul Üçpınar's user avatar
0 votes
2 answers
316 views

Why can't I change the order of the model's array?

I'm currently programming my first SwiftData app. I created two models: Player.swift: @Model final class Player { @Relationship(inverse: \Game.players) var games: [Game] var name: String ...
scotland1912's user avatar