Answers for "swift ui for loopp"

1

for in swiftui

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 "Swift"

Browse Popular Code Answers by Language