The Write.as desktop (GUI) app for macOS.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
821 B

  1. //
  2. // AppDelegate.swift
  3. // writeas
  4. //
  5. // Created by Matt Baer on 12/29/15.
  6. // Copyright © 2015 A Bunch Tell. All rights reserved.
  7. //
  8. import Cocoa
  9. @NSApplicationMain
  10. class AppDelegate: NSObject, NSApplicationDelegate {
  11. var vc: ViewController?
  12. func applicationDidFinishLaunching(aNotification: NSNotification) {
  13. // Insert code here to initialize your application
  14. }
  15. func applicationWillTerminate(_ aNotification: Notification) {
  16. // Insert code here to tear down your application
  17. }
  18. func applicationDidBecomeActive(_ notification: Notification) {
  19. if vc == nil {
  20. vc = NSApplication.shared().mainWindow?.contentViewController as! ViewController
  21. }
  22. }
  23. @IBAction func saveDocument(_ sender: AnyObject) {
  24. vc?.saveDocument()
  25. }
  26. }