Open felixboehm opened 2 years ago
The issue is due to how mapView is keeping stories. When deleting a story in listView, mapView is not updating its collections in time and even without being ontop in Layout hierarchy, mapView is re-creating its collectionData and references to the deleted object.
In ListView I have experimented in using Realm data more directly, accessing the storyDataProvider directly from VC. This works fine and follows the idea to provide story data from the storyDataProvider as "single source of truth for stories". As the story data is not held anymore in the ViewModel,
I will push the example to branch feature/list-realm
Interesting example: https://stackoverflow.com/questions/40028634/creating-an-indexed-tableview-using-realm-in-swift
Maybe related: "Tried to create a story via the story list, uploaded an image and the app crashed after tapping confirm 😱"
Update on reproduction, also crashes on: