 
     func applicationDidFinishLaunching(aNotification: NSNotification)
     {
-        NSNotificationCenter.defaultCenter().addObserver(self, selector: "aWindowBecameMain:",
-                                                                   name: NSWindowDidBecomeMainNotification,
-            													 object: nil)
+        NotificationCenter.default.addObserver(self,
+                                           selector: #selector(AppDelegate.aWindowBecameMain(_:)),
+                                               name: NSWindow.didBecomeMainNotification,
+                                             object: nil)
     }
 
     func applicationWillTerminate(aNotification: NSNotification)

        }
    }

    @objc func aWindowBecameMain(theNotification: NSNotification)
    {
		if let window: NSWindow = theNotification.object as? NSWindow
        {
			if let enigmaController = findEnigmaControllerForWindow(window)
            {
				currentEnigma = enigmaController
            }


    @IBAction func showAbstractEnigma(sender: AnyObject)
    {
        let controller = AbstractEnigmaController()
        abstractEnigmas.append(controller)
        controller.showWindow(sender)
        // TODO: A mechanism to get rid of the controller when we are done
