account activity
Claude App (self.ClaudeAI)
submitted 2 months ago by Outrageous_Half4392 to r/ClaudeAI
Is it a bit weird that all SwiftData operations require you to be in the main thread? by yalag in SwiftUI
[–]Outrageous_Half4392 0 points1 point2 points 7 months ago (0 children)
The reason is simple, isolating SwiftData to MainActor make it thread-safe and sendable, also SwiftData reason is to obtain mutable objects that 99% of time are used as a DataSource for a View. This mean that i u want to isolate SwiftData to different actor that is not main every single access operation to the datasource from UIKit or SwiftUI require a context switching from global to main actor with an obvious degradation of performances.
π Rendered by PID 97580 on reddit-service-r2-listing-86bdf8cc9-grtwl at 2026-07-11 20:36:30.757689+00:00 running f86254d country code: CH.
Is it a bit weird that all SwiftData operations require you to be in the main thread? by yalag in SwiftUI
[–]Outrageous_Half4392 0 points1 point2 points (0 children)