Skip to content

Instantly share code, notes, and snippets.

@aheze
Created October 25, 2024 07:41
Show Gist options
  • Save aheze/4e9ff7ed431a4978327f0fdf00cf940b to your computer and use it in GitHub Desktop.
Save aheze/4e9ff7ed431a4978327f0fdf00cf940b to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Canvas { context, size in
let path = Path(roundedRect: CGRect(origin: .zero, size: size), cornerRadius: 16)
context.fill(path, with: .color(.blue))
}
.border(.red)
}
.padding()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment