📜  添加 arc swiftui - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:58.884000             🧑  作者: Mango

代码示例1
struct MyShape : Shape {
    func path(in rect: CGRect) -> Path {
        var p = Path()

        p.addArc(center: CGPoint(x: 100, y:100), radius: 50, startAngle: .degrees(0), endAngle: .degrees(90), clockwise: true)

        return p.strokedPath(.init(lineWidth: 3, dash: [5, 3], dashPhase: 10))  // To make it a dashed line.
    }    
}