Post

Replies

Boosts

Views

Activity

SwiftUI Shape concurrency warnings
How are SwiftUI Shapes supposed to work with Swift 6? Shape conforms to View which uses @MainActor but the path function and animatableData are both nonisolated. How can they access animatable properties that have to be a var on the main actor? Below is a simple Shape that will show these warnings: struct SimpleShape: Shape { var width: Double var animatableData: Double { get { width } set { width = newValue } } func path(in rect: CGRect) -> Path { var path = Path() let width = self.width path.addRect(.init(origin: rect.origin, size: .init(width: width, height: rect.height))) return path } }
5
1
314
2w