//
//  AppDelegate.swift
//  ShorthandMaster
//
//  Created by 明津李 on 2020/8/10.
//  Copyright © 2020 明津李. All rights reserved.
//

import UIKit
import IQKeyboardManagerSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
        SHStoreManager.launchWithSwiftyStoreKit()
        UMConfigure.initWithAppkey("5f4f1164636b2b13182afc13", channel: "App Store")
        
        MobClick.event("app_start")
        SHUserAccountManager.shared.logCollection(with: .appStart)
        
        IQKeyboardManager.shared.enable = true
        IQKeyboardManager.shared.enableAutoToolbar = false
        
        self.window = UIWindow(frame: UIScreen.main.bounds)
        
        self.window?.rootViewController = SHBaseTabBarController()
        
        window?.makeKeyAndVisible()
        
        return true
    }
    
    func applicationDidBecomeActive(_ application: UIApplication) {
        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "recordAlive"), object: nil)
    }
}

