I have a workaround, but I'm not 100% sure I understand why the Shape properties are nonisolated so I'm not sure if this actually safe or not.
struct SimpleShape: Shape {
var width: Double
nonisolated var animatableData: Double {
get { MainActor.assumeIsolated { width } }
set { MainActor.assumeIsolated { width = newValue } }
}
func path(in rect: CGRect) -> Path {
return Path()
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: