Files
SideStore/AltStore/AppDelegate.swift

63 lines
2.1 KiB
Swift
Raw Normal View History

2019-05-09 12:45:30 -07:00
//
// AppDelegate.swift
// AltStore
//
// Created by Riley Testut on 5/9/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import UIKit
import AltSign
import Roxas
2019-05-09 12:45:30 -07:00
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
2019-05-20 21:24:53 +02:00
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
ServerManager.shared.startDiscovering()
2019-05-20 21:24:53 +02:00
DatabaseManager.shared.start { (error) in
if let error = error
{
print("Failed to start DatabaseManager.", error)
}
else
{
print("Started DatabaseManager")
AppManager.shared.refresh()
2019-05-20 21:24:53 +02:00
}
}
2019-05-09 12:45:30 -07:00
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication)
{
ServerManager.shared.stopDiscovering()
2019-05-09 12:45:30 -07:00
}
func applicationWillEnterForeground(_ application: UIApplication)
{
AppManager.shared.refresh()
ServerManager.shared.startDiscovering()
2019-05-09 12:45:30 -07:00
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}