Created
December 22, 2020 21:59
-
-
Save 0xLeif/845b59a80d7d22903aed6f745e3dbf30 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import SwiftUIKit | |
let sideLength: Float = 64 | |
UIView(backgroundColor: .white).center { | |
UIView { | |
Image("profile_image") | |
.layer(masksToBounds: true) | |
.layer(cornerRadius: sideLength / 2) | |
} | |
.frame(height: sideLength, width: sideLength) | |
.embed(withPadding: [.trailing(0), .top(0), .leading(sideLength / 1.5), .bottom(sideLength / 1.5)]) { | |
Image(.blue) | |
.layer(masksToBounds: true) | |
.layer(cornerRadius: (sideLength - (sideLength / 1.5)) / 2) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment