Skip to content

Conversation

@aiyubinx
Copy link

@aiyubinx aiyubinx commented Jan 8, 2025

@jch5f
In this case, there is a much simpler solution, make the item attribute of the RowView struct an ObservedObject.

Agreed. If we code like this for the row.

Explanation :

  • The RowView was not automatically get updated when the item object in Core Data was changed. This caused inconsistencies in the UI, requiring either a manual refresh or a an app restart to see changes.
  • The 'delete item' did not sync changes between the viewContext and the FetchedResults. This occasionally caused deleted rows to remain visible in the UI, leading to confusion and a poor user experience.

resolved:

  • The RowView now observes its Item using @ObservedObject. This ensures that any changes to Item properties are automatically reflected in the UI without requiring manual refresh mechanisms or app restarts.
  • Additionally, added the swift lint, too. For the time concerns, disabled all the rules as of now.
    Let me know if any other requirements/queries on this.

@jch5f
Copy link
Owner

jch5f commented Jan 8, 2025

Hi @aiyubinx, I appreciate you taking a second crack at this. This matches my expectations much more. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants