Thanks to online tutorials I have been using core data with swift and iOS. To define a context I have used
let context = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext
How do I define the context when writing an OS X application?