SwiftData deleteRules & uniqueness

Hello everyone, How do I need to handle the delete with the relationship deny? When I delete a model that still has a reference to another model, it deletes it from the UI. But when I re-run the simulator, it's back again. Does someone have a hint for me?

How is it possible to ensure the uniqueness of the entries? Because I saw that the Attribute unique can't be used with CloudKit.

Replies

It looks like the onDelete throws void and the other function returns void. Could also be a simple syntax erro.

  • Should I remove the do catch block from the function? What do you suggest for solving this issue?

Add a Comment