I have two classes A and B with a many-to-one relationship from A to B (multiple A objects may reference the same B). The question is, if the delete rule on the A side is C
public override func prepareForDeletion() {
guard let department = department else { return }
if department.employees.filter({ !$0.isDeleted }).isEmpty {
managedObjectContext?.delete(department)
}
}