Post

Replies

Boosts

Views

Activity

Reply to Making View's init nonisolated with environment variables
I'd need nonisolated because I am registering my view using Swinject from a nonisolated context. I also had the case where a developer was doing navigation updates (@MainActor operation) in the init, which was technically possible as the init is @MainActor. What is the technical limitation that enables setting a @State var value in a nonisolated context and that prevents @Environment from being set there ?
Topic: SwiftUI SubTopic:
SwiftUI Q&A
3d
Reply to Making View's init nonisolated with environment variables
Indeed injecting Views is something particular. I will go back thinking about this.
Topic: SwiftUI SubTopic:
SwiftUI Q&A
Replies
Boosts
Views
Activity
3d
Reply to Making View's init nonisolated with environment variables
I'd need nonisolated because I am registering my view using Swinject from a nonisolated context. I also had the case where a developer was doing navigation updates (@MainActor operation) in the init, which was technically possible as the init is @MainActor. What is the technical limitation that enables setting a @State var value in a nonisolated context and that prevents @Environment from being set there ?
Topic: SwiftUI SubTopic:
SwiftUI Q&A
Replies
Boosts
Views
Activity
3d