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.
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")
]