// // AppDelegate.swift // SearchDemo // // Created by Ralf Gronkowski on 13/10/14. // Copyright (c) 2014 Ralf Gronkowski. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { window = UIWindow(frame: UIScreen.mainScreen().bounds) window?.backgroundColor = UIColor.whiteColor() let viewController = ViewController(nibName: nil, bundle: nil) let navController = UINavigationController(rootViewController: viewController) window?.rootViewController = navController let appDefaults = [SettingsKeys.namePreferenceKey: "Joe_Coder",SettingsKeys.passwordPreferenceKey: "perforce",SettingsKeys.p4searchURLPreferenceKey: "http://perforce.p4demo.com:8088/api/",SettingsKeys.swarmURLPreferenceKey: "http://perforce.p4demo.com/"] NSUserDefaults.standardUserDefaults().registerDefaults(appDefaults) NSUserDefaults.standardUserDefaults().synchronize() return true } func applicationDidEnterBackground(application: UIApplication){ NSUserDefaults.standardUserDefaults().synchronize() } func applicationWillEnterForeground(application: UIApplication){ NSUserDefaults.standardUserDefaults().synchronize() } }