Post

Replies

Boosts

Views

Activity

Could Apple Release Mosaic as Demo Code?
Could Apple release the Mosaic project used in WWDC20 session 10149 - https://developer.apple.com/videos/play/wwdc2020/10149/? The project uses CloudKit and/or Core Data with the new SwiftUI, and can help answer questions the community has regarding how these frameworks work together: https://developer.apple.com/forums/thread/650309 https://developer.apple.com/forums/thread/650173 https://developer.apple.com/forums/thread/649860
8
0
1.4k
Jun ’20
Why does path draw towards the opposite direction?
I have the following code snippet that draws a circular sector shape: swift struct CircularSector: Shape { let centralAngle: Angle func path(in rect: CGRect) - Path { let radius = min(rect.width, rect.height) / 2 let center = CGPoint(x: rect.midX, y: rect.midY) var path = Path() path.addArc(center: center, radius: radius, startAngle: .degrees(0), endAngle: centralAngle, clockwise: true) path.addLine(to: center) path.closeSubpath() return path } } When I preview it, swift struct CircularSector_Previews: PreviewProvider { static var previews: some View { CircularSector(centralAngle: .degrees(45)).fill(Color.black) } } } instead of a 45° sector clockwise, it draws a 315° sector counterclockwise.
0
0
503
Feb ’21