Post

Replies

Boosts

Views

Activity

Reply to TabView and Swift Charts giving inconsistent behaviour when swiping between pages
This seems to be a serious bug of SwiftUIs Charts API. In case there are several Chart-Views generated inside a ForEach-Loop the Chart-Views sometimes do not match the data of the relevant loop-run anymore. This bug appears especially as soon as the view was updated by the OS (e.g. switching tabs, scrolling, ...), not so often when the view was generated initially. This bug appeared with one of the latest OS Updates (iOS, iPadOS, macOS). I can't see any misuse here. I also couldn't find a workaround. I recommend reporting this to Apple.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24
Reply to TabView and Swift Charts giving inconsistent behaviour when swiping between pages
This seems to be a serious bug of SwiftUIs Charts API. In case there are several Chart-Views generated inside a ForEach-Loop the Chart-Views sometimes do not match the data of the relevant loop-run anymore. This bug appears especially as soon as the view was updated by the OS (e.g. switching tabs, scrolling, ...), not so often when the view was generated initially. This bug appeared with one of the latest OS Updates (iOS, iPadOS, macOS). I can't see any misuse here. I also couldn't find a workaround. I recommend reporting this to Apple.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to TabView and Swift Charts giving inconsistent behaviour when swiping between pages
Maybe, it's not a bug and I found the solution: Use .id() with Charts, e.g. Chart {...}.id(someHashableObject) Pseudocode example: ForEach (identifiableObjects) { identifiableObject in Chart { // some Marks... } .id(UUID()) } Seems to work in my case.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’24