Combine Publisher for your Core Data entities.
import CoreDataPublisher
let fetchRequest = Entity.fetchRequest()
let entities: AnyPublisher<[Entity], Never> = managedObjectContext.publisher(for: fetchRequest)
You can add CoreDataPublisher to your Xcode project by adding it as dependency.
https://github.com/Gamec/core-data-publisher
Or you can add it to SPM by editing your Package.swift
file:
dependencies: [
.package(url: "https://github.com/Gamec/core-data-publisher", from: "0.1.0")
]