AppDelegate.swift 703 B

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