Use onChange on FetchedResults/@FetchRequest variable or get notified when the variable changes

Hello

    @FetchRequest(
        entity: Book.entity(),
        sortDescriptors: [NSSortDescriptor(keyPath: \Book.entity.date, ascending: true)]
    ) var books: FetchedResults<Book.entity>

How can I get notified when anything in book changes without using

.onRecevie(books.publisher){ _ in
      ....
}

And is there any way to use .onChange modifier with books?

Thank You!

Post not yet marked as solved Up vote post of Jad-T Down vote post of Jad-T
847 views
Add a Comment