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 |
|
12 | let GyroMouseConnectionSuccessNotification = Notification.Name("GyroMouseConnectionSuccess") |
12 |
|
13 | let GyroMouseConnectionFailedNotification = Notification.Name("GyroMouseConnectionFailed") |
13 | let |
14 | let GyroMouseDisconnectedNotification = Notification.Name("GyroMouseDisconnected") |
- | 15 | let GyroMouseGoingBackgroundNotification = Notification.Name("GyroMouseGoingBackground") |
|
14 | 16 | ||
- | 17 | extension String { |
|
- | 18 | var localized: String { |
|
15 |
|
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: |
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. |