Skip to content

Instantly share code, notes, and snippets.

@nicol3a
Last active February 8, 2019 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicol3a/049a77eb3555055cc1661ad9c3928efe to your computer and use it in GitHub Desktop.
Save nicol3a/049a77eb3555055cc1661ad9c3928efe to your computer and use it in GitHub Desktop.
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