Skip to content

Instantly share code, notes, and snippets.

@zhihuitang
Created June 25, 2021 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhihuitang/b89596fe21a0d9c98b16969ba9d80d99 to your computer and use it in GitHub Desktop.
Save zhihuitang/b89596fe21a0d9c98b16969ba9d80d99 to your computer and use it in GitHub Desktop.
struct AvatarView: View {
/// image
let image: String
/// size
let size: CGFloat
/// body
var body: some View {
Image(image)
.resizable()
.frame(width: size, height: size)
.clipShape(Circle())
.overlay(Circle().stroke(Color.white.opacity(0.5), lineWidth: 5))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment