// // AppDelegate.swift // App16 // // Created by Grigor Aghabalyan on 3/25/20. // Copyright © 2020 X-TECH. All rights reserved. // import UIKit import IQKeyboardManagerSwift import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { UINavigationBar.appearance().barTintColor = UIColor(red: 0/255, green: 137/255, blue: 40/255, alpha: 1) UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] UINavigationBar.appearance().tintColor = .white UINavigationBar.appearance().isTranslucent = false if #available(iOS 13.0, *) { // In iOS 13 setup is done in SceneDelegate } else { let window = UIWindow(frame: UIScreen.main.bounds) self.window = window let mainstoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let newViewcontroller:UIViewController = mainstoryboard.instantiateViewController(withIdentifier: "MainViewController") as! MainViewController window.rootViewController = newViewcontroller } IQKeyboardManager.shared.enable = true setDefaultLanguage() return true } func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { if #available(iOS 13.0, *) { // In iOS 13 setup is done in SceneDelegate } else { self.window?.makeKeyAndVisible() } return true } func applicationWillResignActive(_ application: UIApplication) { // Not called under iOS 13 - See SceneDelegate sceneWillResignActive } func applicationDidEnterBackground(_ application: UIApplication) { // Not called under iOS 13 - See SceneDelegate sceneDidEnterBackground } func applicationWillEnterForeground(_ application: UIApplication) { // Not called under iOS 13 - See SceneDelegate sceneWillEnterForeground } func applicationDidBecomeActive(_ application: UIApplication) { // Not called under iOS 13 - See SceneDelegate sceneDidBecomeActive } // MARK: UISceneSession Lifecycle @available(iOS 13.0, *) func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } @available(iOS 13.0, *) func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } private func setDefaultLanguage() { if UserDefaultsHelper.getString(for: .locale) == nil { Settings.changeLanguage(Settings.Languages.Armenian.rawValue, langauge: "Հայերեն") } } }