Skip to content

Instantly share code, notes, and snippets.

@Koshimizu-Takehito
Created August 4, 2024 01:26
Show Gist options
  • Save Koshimizu-Takehito/1a2be566c4889c3074ccc9bb01ea5143 to your computer and use it in GitHub Desktop.
Save Koshimizu-Takehito/1a2be566c4889c3074ccc9bb01ea5143 to your computer and use it in GitHub Desktop.
UnevenRoundedRectangle Sample
import SwiftUI
struct ContentView: View {
var body: some View {
Group {
HelloWorld()
.clipShape(UnevenRoundedRectangle(
topLeadingRadius: 80,
bottomTrailingRadius: 80
))
HelloWorld()
.clipShape(.rect(
topLeadingRadius: 80,
bottomTrailingRadius: 80
))
}
.padding(.horizontal)
.padding()
}
}
struct HelloWorld: View {
var body: some View {
Text("Hello, world!")
.font(.largeTitle.bold())
.foregroundStyle(.white)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.blue.gradient)
}
}
#Preview {
ContentView()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment