TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Animation (Transition) applies to all elements in ForEach instead of one. Different animation behavior on preview and device

Forums > SwiftUI

The problem is with the elements’ animation inside of ForEach. It works well in preview - when I add or delete items each individual animates separately. BUT when I run it on simulator or my device animation is applied to the whole list of elements. I have no idea why… Interesting thing is that the list of selected exercises is okay always, but the list of exercises available to pick is broken.

I made a notion page with more information and videos of problem. Would be really greatful if you help me with fixing it. Thank you very much!

https:// DELETE SPACE emphasized-prose-caf.notion DELETE SPACE .site/Problem-code-50cde42166414591bb97e9b6091944bb?pvs=4

2      

I've encountered similar challenges in the past, and troubleshooting can indeed be tricky.

To assist you better, I recommend checking the following:

  1. Verify that your Xcode and SwiftUI versions are up to date, as outdated versions can sometimes lead to unexpected behavior.
  2. Double-check the animation code within the ForEach loop to ensure it's correctly configured for individual elements.
  3. Review the Notion page you provided for more insights. It's a helpful resource for understanding the problem.

I've faced my share of coding puzzles, much like navigating through the intricacies of uaesafari. If the issue persists, consider seeking advice from relevant forums or communities where developers share their experiences.

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.