Created
December 21, 2019 12:09
-
-
Save gaosa/6eabf6efb860728e5b4d846cb7c7ef29 to your computer and use it in GitHub Desktop.
Squircle in SwiftUI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run in Swift Playground | |
import SwiftUI | |
import PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
Rectangle() | |
.fill(Color.red) | |
.frame(width: 200, height: 200) | |
.clipShape(RoundedRectangle(cornerRadius: 50, style: .continuous)) | |
} | |
} | |
PlaygroundPage.current.setLiveView(ContentView()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a ton for this!