Closed dwnz closed 9 months ago
Hi @dwnz
I'm happy to hear that you like it!
I would prefer to not modify the original list like this:
ForEach(Array(items.enumerated()), id: \.offset) { ... }
This would cause the component to list a different collection that what you pass in, and I'm not sure if this would cause problems when working with he collection 🤔
Would it work for you to map the original items to a type that has an index
?
Heya, @danielsaidi ,
Cheers for the response. Yeah that's probably fair - was thinking of something similar to how the Swift ForEach works
Have just updated my original items to include an index, works all good. Thanks again!
Perfect 🙌
Heya,
Have been playing around with ReorderableForEach - it's awesome! Cheers for the method.
One thing I need is the index of the element, was using the SwiftUI ForEach and passing the index through to the view, doesn't appear there's a way to do this with the method? I attempted to add it myself but got a little lost
Is there any chance of getting it added when you have a spare moment? Cheers!