Class
AppDelegate
@available(iOS 10.0, *) @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate
Relationships
Conforms To
UIApplicationDelegate
UIResponder
UNUserNotificationCenterDelegate
Properties
window
var window: UIWindow?
Methods
application(_:didFinishLaunchingWithOptions:)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
application(_:performFetchWithCompletionHandler:)
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
Background fetch function. Tries the fetch data when the app is in background
Parameters
Name | Type | Description |
---|---|---|
application | UIApplication |
The current application |
completionHandler | @escaping (UIBackgroundFetchResult) -> Void |
checks whether new data has been fetched |
applicationWillResignActive(_:)
func applicationWillResignActive(_ application: UIApplication)
applicationDidEnterBackground(_:)
func applicationDidEnterBackground(_ application: UIApplication)
applicationWillEnterForeground(_:)
func applicationWillEnterForeground(_ application: UIApplication)
applicationDidBecomeActive(_:)
func applicationDidBecomeActive(_ application: UIApplication)
applicationWillTerminate(_:)
func applicationWillTerminate(_ application: UIApplication)
application(_:didRegisterForRemoteNotificationsWithDeviceToken:)
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
application(_:didFailToRegisterForRemoteNotificationsWithError:)
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error)
setupDatabase(_:)
private func setupDatabase(_ application: UIApplication) throws
Sets up the internal swl database which is currently not in use
registerForPushNotifications()
func registerForPushNotifications()
Registers the app for push notification
getNotificationSettings()
func getNotificationSettings()
Gets the notification settings for local notification
userNotificationCenter(_:willPresent:withCompletionHandler:)
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
userNotificationCenter(_:didReceive:withCompletionHandler:)
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)
downloadNotificationSound()
func downloadNotificationSound()
Download the custom notifcation sound that's to be used