Subversion Repositories Mobile Apps.GyroMouse

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 7
Line 6... Line 6...
6
//  Copyright © 2015 Matteo Riva. All rights reserved.
6
//  Copyright © 2015 Matteo Riva. All rights reserved.
7
//
7
//
8
 
8
 
9
import UIKit
9
import UIKit
10
 
10
 
-
 
11
let GyroMouseShouldRefreshServerListNotification = Notification.Name("GyroMouseShouldRefreshServerList")
11
//let yellow = UIColor(red: 255.0/255.0, green: 223.0/255.0, blue: 17.0/255.0, alpha: 1)
12
let GyroMouseConnectionSuccessNotification = Notification.Name("GyroMouseConnectionSuccess")
12
//let blue = UIColor(red: 41.0/255.0, green: 95.0/255.0, blue: 196.0/255.0, alpha: 1)
13
let GyroMouseConnectionFailedNotification = Notification.Name("GyroMouseConnectionFailed")
13
let minimumVersion = 0
14
let GyroMouseDisconnectedNotification = Notification.Name("GyroMouseDisconnected")
-
 
15
let GyroMouseGoingBackgroundNotification = Notification.Name("GyroMouseGoingBackground")
14
 
16
 
-
 
17
extension String {
-
 
18
    var localized: String {
15
let DidEnterBackgroundNotification = Notification.Name("DidEnterBackgroundNotification")
19
        return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "")
-
 
20
    }
-
 
21
}
16
 
22
 
17
@UIApplicationMain
23
@UIApplicationMain
18
class AppDelegate: UIResponder, UIApplicationDelegate {
24
class AppDelegate: UIResponder, UIApplicationDelegate {
19
 
25
 
20
    var window: UIWindow?
26
    var window: UIWindow?
Line 35... Line 41...
35
        return true
41
        return true
36
    }
42
    }
37
 
43
 
38
    func applicationWillResignActive(_ application: UIApplication) {
44
    func applicationWillResignActive(_ application: UIApplication) {
39
        client.stopBrowsing()
45
        client.stopBrowsing()
40
        NotificationCenter.default.post(name: DidEnterBackgroundNotification, object: nil)
46
        NotificationCenter.default.post(name: GyroMouseGoingBackgroundNotification, object: nil)
41
    }
47
    }
42
 
48
 
43
    func applicationDidEnterBackground(_ application: UIApplication) {
49
    func applicationDidEnterBackground(_ application: UIApplication) {
44
        /// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
50
        /// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
45
        /// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
51
        /// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.