Skip to content

Instantly share code, notes, and snippets.

@arkivanov
Created June 9, 2020 12:53
Show Gist options
  • Select an option

  • Save arkivanov/3b030504b8ff5a25dc53d024a2c007c2 to your computer and use it in GitHub Desktop.

Select an option

Save arkivanov/3b030504b8ff5a25dc53d024a2c007c2 to your computer and use it in GitHub Desktop.
struct KittenSwiftView: View {
@ObservedObject var proxy: KittenViewProxy
var body: some View {
}
private var content: some View {
let model: KittenViewModel! = self.proxy.model
return Group {
if (model == nil) {
EmptyView()
} else if (model.isError) {
Text("Error loading kittens :-(")
} else {
List {
ForEach(model.imageUrls) { item in
RemoteImage(url: item)
.listRowInsets(EdgeInsets())
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment