I have an array and I want to iterate through it initialize views based on array value, and want to perform action based on array item index
When I iterate through o
Another approach is to use:
ForEach(Array(array.enumerated()), id: \.offset) { index, element in // ... }
Source: https://alejandromp.com/blog/swiftui-enumerated/