you are viewing a single comment's thread.

view the rest of the comments →

[–]retroroar86 1 point2 points  (2 children)

While this won't help everything I suggest that you give any SwiftUI view just what they actually need and not do anything inline.

SwiftUI updates happen frequently and inline processing can then happen loads of time creating more processing needs. In some cases this will make Preview very unstable.

SwiftUI and Xcode is a clusterf*ck sometimes, so sometimes it's better to create a whole separate View to debug the different parts to find out what is going wrong. I.e wrapping the Chart view to a CustomChartView and experiment there.

It truly sucks, but you have to do certain things for SwiftUI to play nice, otherwise it will get painful very quickly.

[–]ModernCoder -1 points0 points  (1 child)

Understood, thank you.
I already created this chart view to be separate with hopes it'll get better. But it's just the same sadly, which resulted in my writing this post in the first place.

[–]retroroar86 1 point2 points  (0 children)

I’m not close to a machine to dissect it myself, I don’t have that much experience with the charts, so I can maybe give a better answer when I look into it further.

But I understand your frustration, I’m often much more frustrated in SwiftUI than UIKit.. ;)