Answers for "how to use offset so that same view gets called in a loop in swiftUI"

1

foreach swiftui object

struct ContentView: View {
    let colors: [Color] = [.red, .green, .blue]

    var body: some View {
        VStack {
            ForEach(colors, id: \.self) { color in
                Text(color.description.capitalized)
                    .padding()
                    .background(color)
            }
        }
    }
}
Posted by: Guest on January-07-2020

Code answers related to "how to use offset so that same view gets called in a loop in swiftUI"

Code answers related to "Swift"

Browse Popular Code Answers by Language