AppDelegate.swift 781 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // AppDelegate.swift
  3. // QuickProtoApp
  4. //
  5. // Created by Tim Burks on 9/15/16.
  6. // Copyright © 2016 Google. All rights reserved.
  7. //
  8. import Cocoa
  9. @NSApplicationMain
  10. class AppDelegate: NSObject, NSApplicationDelegate {
  11. @IBOutlet weak var window: NSWindow!
  12. func applicationDidFinishLaunching(_ aNotification: Notification) {
  13. let fileDescriptorSet = FileDescriptorSet(filename: "maps.out")
  14. let messageURL = Bundle.main.url(forResource: "maptest", withExtension: "bin")!
  15. let messageData = try! Data(contentsOf:messageURL)
  16. let message = fileDescriptorSet.readMessage("MapTest", data:messageData)!
  17. message.display()
  18. }
  19. func applicationWillTerminate(_ aNotification: Notification) {
  20. // Insert code here to tear down your application
  21. }
  22. }