TIL: enumerated() in ForEach in SwiftUI

Because every time I want to use a ForEach-Loop or something that iterates over an array and I need an index too, I forget how to do this in SwiftUI: here is the solution!

Today I learned how to iterate over an array in a ForEach-Loop and access the index of the element too.

ForEach(Array(zip(items.indices, items)), id: \.0) { index, item in
  // index and item are both safe to use here
}

Source: StackOverflow