Skip to content

Instantly share code, notes, and snippets.

@dmytro-anokhin
Last active June 8, 2019 15:18
Show Gist options
  • Select an option

  • Save dmytro-anokhin/c2b5e68db936c62351b3ea9e92d32452 to your computer and use it in GitHub Desktop.

Select an option

Save dmytro-anokhin/c2b5e68db936c62351b3ea9e92d32452 to your computer and use it in GitHub Desktop.
struct ImageListView : View {
let urls = (300..<325).map { "https://picsum.photos/\($0)" }.map { URL(string: $0)! }
var body: some View {
NavigationView {
List(urls.identified(by: \.self)) { url in
NavigationButton(destination: ImageDetailView(url: url)) {
HStack {
URLImage(url: url)
.frame(minWidth: 100.0, maxWidth: 100.0, minHeight: 100.0, maxHeight: 100.0)
.clipped()
Text("\(url)")
}
}
}
.navigationBarTitle(Text("Images"))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment