I'm trying to create a publisher for CoreData changes.
I've implemented Publisher protocol and I was required to implement NSFetchedResultsControllerDelegate in same type (not in extension).
Next, I need to implement different NSFetchedResultsControllerDelegate methods for different Outputs.
But when I add constraint where to method, xcode tells that it is not protocol method but "nearly matches optional requirement" and this method not called.
func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>)
where Output == [T]
{
}
func controller(
_ controller: NSFetchedResultsController<NSFetchRequestResult>,
didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference)
where Output == PublishedSnapshot
{
}
I can't implement both methods without any conditions because ```controller(:didChangeContentWith) hides all other delegate methods.
What should I do to implement different methods depending on Output type?