Last active
November 14, 2019 05:57
-
-
Save garsdle/e3721beb5e10d345fe7a1d3fd39836fd 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
struct AvatarView: View { | |
var image: UIImage? | |
var initials: String? | |
var body: some View { | |
OptionalView(image) { image in | |
Image(uiImage: image) | |
} | |
.fallbackView(initials) { initials in | |
Text(initials) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment