Skip to content

Instantly share code, notes, and snippets.

@nicol3a
Last active February 3, 2019 20:07
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/6d0fc47a957b2e4e019ac164fde7b8e9 to your computer and use it in GitHub Desktop.
Save nicol3a/6d0fc47a957b2e4e019ac164fde7b8e9 to your computer and use it in GitHub Desktop.
@objc(EventManagedObject)
public class EventManagedObject: NSManagedObject, ManagedObjectConvertible {
typealias T = Event
func from(object: Event) {
title = object.title
date = object.date
}
func toObject() -> Event {
return Event(
title: title ?? "",
lastDate: date,
identifier: identifier
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment