Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yfujiki/9057f3fd3004a95130dc4d904d41d11f to your computer and use it in GitHub Desktop.
Save yfujiki/9057f3fd3004a95130dc4d904d41d11f to your computer and use it in GitHub Desktop.
HStack {
ForEach(stride(from: 0, to: catFoods.count, by: 2).map{ $0 }) { i in
VStack {
Image(catFoods[i])
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: UIScreen.main.bounds.width / 2 - 40, height: 100)
.padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
Image(catFoods[i + 1])
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: UIScreen.main.bounds.width / 2 - 40, height: 100)
.padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
}
}
}.padding(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment