-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppDelegate.swift
45 lines (35 loc) · 1.33 KB
/
AppDelegate.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// AppDelegate.swift
// ContactList
//
// Created by H on 08/08/2019.
// Copyright © 2019 H. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
fileprivate func initIQKeyboardManager() {
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ContactInfoService.shared.copyJsonIfNeeded()
let cl = ContactListVC()
let navVC = UINavigationController(rootViewController: cl)
navVC.navigationBar.tintColor = accentColor
self.window?.rootViewController = navVC
self.window?.makeKeyAndVisible()
initIQKeyboardManager()
#if targetEnvironment(simulator)
// Disable hardware keyboards.
let setHardwareLayout = NSSelectorFromString("setHardwareLayout:")
UITextInputMode.activeInputModes
// Filter `UIKeyboardInputMode`s.
.filter({ $0.responds(to: setHardwareLayout) })
.forEach { $0.perform(setHardwareLayout, with: nil) }
#endif
return true
}
}