|
I have checked out the workaround (.id(UUID()) ) for the bug in scrollTo - List in iOS 16, but my project is using List ForEach and I cannot ge tthe scrolling to work (no crashes however). I just complete the 100 Days, so it is propbably a newbie dumb mistake? The commented out id I tried causes the compiler to timeout - unable to complete type checking... Thanks
|
|
Just looking at the code and think you need the
Try paste this in a test project to see |
|
I think @Nigel has the right answer. Also, if you've finished the 100 Days of SwiftUI lessons, consider moving this code into your
Then in your
This simple change will make your code easier to read. It's more Swifty! |
|
Thanks for the input. 1) @Obelix I have a computed background color var now for rows in this view. 2) @NigelGee I managed to find the right combination of .id() and scrollTo for my situation based on your example:
|
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ โ it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.