Skip to content

Instantly share code, notes, and snippets.

@nicol3a

nicol3a/EventStore.swift

Last active Feb 8, 2019
Embed
What would you like to do?
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