79537955

Date: 2025-03-27 06:08:22
Score: 3
Natty:
Report link

thanks for sharing with us some snippets of code. To let us help you faster, could you present a minimum reproducible code? We aren't sure how the views were created and arranged so it's hard to answer right away. I'll edit my answer once I test it out.

In the meantime, you can follow @workingdog's suggestion on using @Binding instead of @State:

/// Binding vars getting from the View Calling this View
    @Binding var methods: [TapasAsana]
    @Binding var type: timerType
    @Binding var recoupExecutions: Int

After a lot of research it seemed that the Device gets overwhelmed trying to initialise all these State Variables. As the MacBook has more resources it won't freeze.

Also, you should use the debugging tools XCode has, such as Instruments or the debug navigator on the left panel to identify other objects that may be eating resources during runtime.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (2): thanks for sharing
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: UnstoppableWil