Post

Replies

Boosts

Views

Activity

Reply to Replacing array in Observed object won't update UI.
Thank you for going over it. Your explanations makes sense and I understand what you say but I think there seems to be a problem when modifying the "ID" of on object. Im not sure if there is a distinction between the "ID" and "hasChanged". Also this leads to runtime crashes with following error: Thread 1: Fatal error: Duplicate keys of type 'MyObservableItem' were found in a Dictionary. I think the correct way to handle this should be to leave the ID the same (also for things like reordering animations) and somehow still indicating a change. Including a changing property in the hash or == means that changing a property also changes the identity of an object, at least when using .self as the ID, which seems to create issues on how SwiftUI seems to track changes to an ForEach loop. One MyObservableItem seems to be in a Dictionary associated with a key (probably the id). Manipulating the hash with property changes results in unexpected behavior and crashes.
2w
Reply to error: the replacement path doesn't exist:
When you have this error in the logs, try the following: Get the derived data folder handy. Clean and Close Xcode. Find the following folder: /var/folders/1q/6jw9d6mn0gx1znh1n19z2v9r0000gp/T/swift-generated-sources The random string could be different for you. Delete the contents of the derived data folder. Delete the contents of the swift-generated-sources. In the var/folder..../T folder, scroll to the tip and also delete any dev related files starting with an _. Now: Launch Xcode with your project. Resolve packages if you have any. Build and run.
2d