Post

Replies

Boosts

Views

Activity

Reply to onPreferenceChange closure is now nonIsolated?
You could capture the state/binding and mutate the wrapped value, e.g. .onPreferenceChange(SizeKey.self) { [$size] size in $size.wrappedValue = size } Btw the thread title is misleading, onPreferenceChange was always nonisolated, what changed is the action closure becoming @Sendable.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24