Answers for "swiftui foreach from 0 to 5"

1

swiftui foreach with index

var body: some View {
        ForEach(array.indices) { i in
          Text("(self.array[i])")
            .onTapGesture { self.doSomething(index: i) }
        }
    }
Posted by: Guest on September-10-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language