Created
June 10, 2019 23:11
-
-
Save josephlord/02175a2923144cee8be2f41bcad685de to your computer and use it in GitHub Desktop.
Snippet of start of Core Data class (NSManagedObject subclass) with enough code to make it into a Bindable object
This file contains hidden or 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
public class ListContent : NSManagedObject, BindableObject { | |
public let didChange = PassthroughSubject<Void, Never>() | |
private var changePublisher: PassthroughSubject<Void, Never> { | |
return didChange | |
} | |
override public func didChangeValue(forKey key: String) { | |
super.didChangeValue(forKey: key) | |
self.changePublisher.send(()) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment