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.
Post
Replies
Boosts
Views
Activity
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.
Same here. I had it working in Debug builds and TestFlight debug builds. Shipped the app and noticed the avatars did it appear. Confirmed it is not working any more, even in Debug builds. I tried a lot of things, including changing the notification title just to indicate any change at all and got it working for Debug builds. Tried an Ad-Hoc Release build and it back to not working…