title: managedObjectContext in Swift 3
body: <p>I want to work through <a href="https://www.brandpending.com/2016/01/14/using-core-data-in-a-swift-cocoa-app-to-populate-an-nstableview/" rel="noreferrer">this example code</a> in which Swift and CoreData is used to create a table. However, using Swift 3 I fail to get it to work. Most importantly, I cannot properly replace the line</p>
  
  <pre><code>// set up the NSManagedObjectContext
    let appDelegate = NSApplication.sharedApplication().delegate as! AppDelegate
    managedContext = appDelegate.managedObjectContext
  </code></pre>
  
  <p>even though I found <a href="https://stackoverflow.com/questions/37956720/how-to-create-managedobjectcontext-using-swift-3-in-xcode-8">this related question</a> (which however is iOS not OS X). How can I replace that piece of code which produces the error message <code>Value of type 'AppDelegate' has no member 'managedContext'</code>?</p>