66// Copyright © 2016 cuappdev. All rights reserved.
77//
88
9- import UIKit
9+ import Crashlytics
10+ import Fabric
1011import Firebase
1112import GoogleMaps
1213import GooglePlaces
13- import SwiftyJSON
14- import Fabric
15- import Crashlytics
14+ import Intents
1615import SafariServices
16+ import SwiftyJSON
17+ import UIKit
1718import WhatsNewKit
1819
1920// This is used for app-specific preferences
@@ -78,7 +79,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7879 let navigationController = showOnboarding ? OnboardingNavigationController ( rootViewController: rootVC) :
7980 CustomNavigationController ( rootViewController: rootVC)
8081
81- // v1.3 Data Migration
82+ patchFunctions ( rootVC: rootVC)
83+
84+ // Initalize window without storyboard
85+ self . window = UIWindow ( frame: UIScreen . main. bounds)
86+ self . window!. rootViewController = navigationController
87+ self . window? . makeKeyAndVisible ( )
88+
89+ return true
90+ }
91+
92+ func patchFunctions( rootVC: UIViewController ) {
93+
8294 if
8395 VersionStore . shared. savedAppVersion <= WhatsNew . Version ( major: 1 , minor: 2 , patch: 1 ) ,
8496 let homeViewController = rootVC as? HomeViewController
@@ -92,13 +104,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
92104 Analytics . shared. log ( payload)
93105 }
94106 }
95-
96- // Initalize window without storyboard
97- self . window = UIWindow ( frame: UIScreen . main. bounds)
98- self . window!. rootViewController = navigationController
99- self . window? . makeKeyAndVisible ( )
100-
101- return true
107+
108+ // v1.4.1 Delete Corrupted Shortcut Donations
109+ if VersionStore . shared. savedAppVersion <= WhatsNew . Version ( major: 1 , minor: 4 , patch: 0 ) {
110+ print ( " Begin Deleting Corrupt Shortcut Donations " )
111+ INInteraction . deleteAll { ( error) in
112+ if let error = error {
113+ print ( " Failed to delete corrupt shortcut donations with error: \( error. localizedDescription ) " )
114+ } else {
115+ print ( " Succesfully deleted corrupt shortcut donations " )
116+ }
117+ }
118+ }
102119 }
103120
104121 func application( _ application: UIApplication , performActionFor shortcutItem: UIApplicationShortcutItem , completionHandler: @escaping ( Bool ) -> Void ) {
0 commit comments