AppDelegate.swift 654 B

1234567891011121314151617181920212223242526
  1. //
  2. // AppDelegate.swift
  3. // TestSwift
  4. // Copyright (c) 2014 Damian Kołakowski. All rights reserved.
  5. //
  6. import Foundation
  7. import UIKit
  8. @UIApplicationMain
  9. class AppDelegate: UIResponder, UIApplicationDelegate {
  10. var window: UIWindow?
  11. var server: HttpServer?
  12. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
  13. let server = demoServer(NSBundle.mainBundle().resourcePath)
  14. self.server = server
  15. var error: NSError?
  16. if server.start(error: &error) {
  17. println("Server start error: \(error)")
  18. }
  19. return true
  20. }
  21. }