Created
July 15, 2019 14:25
-
-
Save 0xMarK/5d5a9574d46d330f5158637bb259f967 to your computer and use it in GitHub Desktop.
SwifttUI CoreData integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDataModel: BindableObject { | |
var didChange = PassthroughSubject<Void, Never>() | |
} | |
extension MyDataModel: NSFetchedResultsControllerDelegate { | |
func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) { | |
didChange.send() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment