Last active
February 8, 2019 23:12
-
-
Save nicol3a/049a77eb3555055cc1661ad9c3928efe to your computer and use it in GitHub Desktop.
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 EventStore { | |
private let context: NSManagedObjectContext | |
init(context: NSManagedObjectContext) { | |
self.context = context | |
} | |
func insert(_ event: Event) { | |
EventManagedObject.insert(event, with: context) | |
} | |
func update(_ event: Event) { | |
EventManagedObject.update(event, with: context) | |
} | |
func delete(_ event: Event) { | |
EventManagedObject.delete(event, with: context) | |
} | |
func fetchAll() -> [Event] { | |
return EventManagedObject.fetchAll(from: context) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment