Skip to content

Instantly share code, notes, and snippets.

@0xLeif
Created December 22, 2020 21:59
Show Gist options
  • Save 0xLeif/845b59a80d7d22903aed6f745e3dbf30 to your computer and use it in GitHub Desktop.
Save 0xLeif/845b59a80d7d22903aed6f745e3dbf30 to your computer and use it in GitHub Desktop.
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