Skip to content

Instantly share code, notes, and snippets.

@Jpunt
Last active June 6, 2019 12:24
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 Jpunt/060dfe00ec059f44b8639885227e1d59 to your computer and use it in GitHub Desktop.
Save Jpunt/060dfe00ec059f44b8639885227e1d59 to your computer and use it in GitHub Desktop.
var body: some View {
List(tweets.identified(by: \.id)) { tweet in
HStack {
Text(tweet.message)
tweet.imageName.map
{ ViewBuilder.buildEither(first: Image($0) }
?? ViewBuilder.buildEither(second: Text("No image"))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment