@@ -13,12 +13,18 @@ import Mixpanel
13
13
import Fabric
14
14
import Crashlytics
15
15
16
+ /// TLIAppDelegate Application Logic.
16
17
@UIApplicationMain
17
18
class TLIAppDelegate : UIResponder , UIApplicationDelegate {
18
19
20
+ /**
21
+ Identifier for 3d Touch.
22
+
23
+ - CreateNewList: Create a new list.
24
+ */
19
25
enum ShortcutIdentifier : String {
20
- case CreateNewList
21
26
27
+ case CreateNewList
22
28
init ? ( fullIdentifier: String ) {
23
29
guard let shortIdentifier = fullIdentifier. componentsSeparatedByString ( " . " ) . last else {
24
30
return nil
@@ -27,9 +33,17 @@ class TLIAppDelegate: UIResponder, UIApplicationDelegate {
27
33
}
28
34
}
29
35
36
+ /// The instance of the UIWindow.
30
37
var window : UIWindow ?
38
+
39
+ /// Access globally network status.
31
40
var networkMode : String ?
32
41
42
+ /**
43
+ Singleton of TLIAppDelegate
44
+
45
+ - Returns: TLIAppDelegate instance.
46
+ */
33
47
class func sharedAppDelegate( ) -> TLIAppDelegate {
34
48
return UIApplication . sharedApplication ( ) . delegate as! TLIAppDelegate
35
49
}
@@ -38,22 +52,21 @@ class TLIAppDelegate: UIResponder, UIApplicationDelegate {
38
52
func application( application: UIApplication , performActionForShortcutItem shortcutItem: UIApplicationShortcutItem ,
39
53
completionHandler: ( Bool ) -> Void ) {
40
54
41
- completionHandler ( handleShortcut ( shortcutItem) )
55
+ completionHandler ( handleShortcut ( shortcutItem) )
42
56
}
43
57
44
58
func application( application: UIApplication , didFinishLaunchingWithOptions launchOptions: [ NSObject : AnyObject ] ? ) -> Bool {
45
59
46
60
if #available( iOS 9 . 0 , * ) {
47
61
if let shortcutItem = launchOptions ? [ UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem {
48
- print ( shortcutItem)
49
62
handleShortcut ( shortcutItem)
50
63
return false
51
64
}
52
65
} else {
53
66
//print("quick actions not supported")
54
67
}
55
68
56
- //Register defaults
69
+ // Register defaults
57
70
58
71
if #available( iOS 9 , * ) {
59
72
let standardDefaults = NSUserDefaults . standardUserDefaults ( )
@@ -74,9 +87,7 @@ class TLIAppDelegate: UIResponder, UIApplicationDelegate {
74
87
}
75
88
76
89
do {
77
-
78
90
try NSFileManager . defaultManager ( ) . createDirectoryAtURL ( TLICDController . sharedInstance. storeDirectoryURL!, withIntermediateDirectories: true , attributes: nil )
79
-
80
91
} catch {
81
92
fatalError ( " Cannot create directory \( error) " )
82
93
}
0 commit comments