๐Ÿ…ฟ๏ธShape

Examples

import SwiftUI
import PlaygroundSupport

// ContentView
struct ContentView: View {
    
    // body
    var body: some View {
        VStack{
            hstack1
            hstack2
        }.padding()
    }
    
    var hstack1: some View {
        HStack{
            Group{
                Triangle()
                    .stroke()
                Triangle()
                    .fill(Color.red)
                Triangle()
                    .stroke(Color.red, style: StrokeStyle(lineWidth: 10, lineCap: .round, lineJoin: .round))
                Arc(start: 110, end: 0, clockwise: true)
                    .stroke(lineWidth: 10)
                    .stroke(lineWidth: 5)
                    .stroke()
            }
            .frame(width: 100, height: 100)
            .border(Color.orange)
        }
    }
    
    var hstack2: some View {
        HStack{
            Group{
                Arc(start: 90, end: 0, clockwise: true)
                    .stroke(Color.blue, lineWidth: 20)
                Arc(start: 0, end: 270, clockwise: true)
                    .stroke(Color.pink, lineWidth: 8)
            }
            .frame(width: 208, height: 100)
            .border(Color.yellow)
        }
    }
}

PlaygroundPage.current.setLiveView(ContentView())

็ฏ„ไพ‹

Last updated