Hi everyone, does anyone have a suggestion on how I can add a detail view to this grid view?
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
List {
ImageRow()
}.navigationBarTitle(Text("Landscapes"))
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
import SwiftUI
import Combine
struct ImageRow: View {
var body: some View {
var images: [[Int]] = []
_ = (1...18).publisher
.collect(2) // Creating two columns
.collect()
.sink(receiveValue: { images = $0 })
return ForEach(0..<images.count, id: \.self) { array in
HStack {
ForEach(images[array], id: \.self) { number in
Image("noaa\(number)")
.resizable()
.scaledToFit()
.cornerRadius(10)
}
}
}
}
}