2015-12-30 02:51:22 -08:00
|
|
|
//
|
|
|
|
|
// AppDelegate.swift
|
|
|
|
|
// XIONControlPanel
|
|
|
|
|
//
|
|
|
|
|
// Created by Charles Magahern on 12/29/15.
|
|
|
|
|
// Copyright © 2015 XION. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
|
|
@UIApplicationMain
|
2016-07-24 00:14:04 -07:00
|
|
|
class AppDelegate: UIResponder, UIApplicationDelegate
|
|
|
|
|
{
|
2015-12-30 02:51:22 -08:00
|
|
|
var window: UIWindow?
|
2016-01-03 13:21:50 -08:00
|
|
|
var mainViewController: MainViewController = MainViewController()
|
2015-12-30 02:51:22 -08:00
|
|
|
|
2017-05-13 00:40:03 -07:00
|
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
|
2015-12-30 02:51:22 -08:00
|
|
|
{
|
2017-05-13 00:40:03 -07:00
|
|
|
application.isStatusBarHidden = true
|
2015-12-30 02:51:22 -08:00
|
|
|
|
2017-05-13 00:40:03 -07:00
|
|
|
self.window = UIWindow(frame: UIScreen.main.bounds)
|
2016-01-03 13:21:50 -08:00
|
|
|
self.window?.rootViewController = self.mainViewController
|
2015-12-30 02:51:22 -08:00
|
|
|
self.window?.makeKeyAndVisible()
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 00:40:03 -07:00
|
|
|
func applicationDidBecomeActive(_ application: UIApplication)
|
2016-01-03 13:21:50 -08:00
|
|
|
{
|
|
|
|
|
self.mainViewController.viewDidAppear(false)
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 00:40:03 -07:00
|
|
|
func applicationDidEnterBackground(_ application: UIApplication)
|
2016-01-03 13:21:50 -08:00
|
|
|
{
|
|
|
|
|
self.mainViewController.viewDidDisappear(false)
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 00:40:03 -07:00
|
|
|
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask
|
2015-12-30 02:51:22 -08:00
|
|
|
{
|
2017-05-13 00:40:03 -07:00
|
|
|
var mask: UIInterfaceOrientationMask = .portrait
|
2016-07-24 00:14:04 -07:00
|
|
|
|
2017-05-13 00:40:03 -07:00
|
|
|
if (UIDevice.current.userInterfaceIdiom == .phone) {
|
|
|
|
|
mask = UIInterfaceOrientationMask.portrait
|
2016-07-24 00:14:04 -07:00
|
|
|
} else {
|
2017-05-13 00:40:03 -07:00
|
|
|
mask = UIInterfaceOrientationMask.all
|
2016-07-24 00:14:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mask
|
2015-12-30 02:51:22 -08:00
|
|
|
}
|
|
|
|
|
}
|