56 lines
1.5 KiB
Swift
56 lines
1.5 KiB
Swift
//
|
|
// AppDelegate.swift
|
|
// XIONControlPanel
|
|
//
|
|
// Created by Charles Magahern on 12/29/15.
|
|
// Copyright © 2015 XION. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
@UIApplicationMain
|
|
class AppDelegate: UIResponder, UIApplicationDelegate
|
|
{
|
|
var window: UIWindow?
|
|
var mainViewController: MainViewController = MainViewController()
|
|
|
|
func application(_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
|
|
{
|
|
self.window = UIWindow()
|
|
self.window?.rootViewController = self.mainViewController
|
|
self.window?.makeKeyAndVisible()
|
|
|
|
return true
|
|
}
|
|
|
|
func applicationDidBecomeActive(_ application: UIApplication)
|
|
{
|
|
mainViewController.applicationDidBecomeActive()
|
|
}
|
|
|
|
func applicationWillResignActive(_ application: UIApplication)
|
|
{
|
|
mainViewController.applicationWillResignActive()
|
|
}
|
|
|
|
func applicationDidEnterBackground(_ application: UIApplication)
|
|
{
|
|
mainViewController.applicationWillResignActive()
|
|
}
|
|
|
|
func application(_ application: UIApplication,
|
|
supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask
|
|
{
|
|
var mask: UIInterfaceOrientationMask = .portrait
|
|
|
|
if (UIDevice.current.userInterfaceIdiom == .phone) {
|
|
mask = UIInterfaceOrientationMask.portrait
|
|
} else {
|
|
mask = UIInterfaceOrientationMask.all
|
|
}
|
|
|
|
return mask
|
|
}
|
|
}
|