// // LaunchVC.swift // QuJingApp // // Created by 方楚豪 on 2022/5/18. // import UIKit import MMKV class LaunchVC: UIViewController { var mmkv:MMKV = MMKV.default()! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. let result = mmkv.bool(forKey: AgreementVC.ENTER_KEY, defaultValue: false) if result { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { //show main vc AppUtils.shared.showMainController() } }else { //实例化一个将要跳转的viewControlleru let agreementVC = AgreementVC() let controller = self.storyboard?.instantiateViewController(withIdentifier: String(describing: type(of: agreementVC))) as! AgreementVC self.navigationController?.pushViewController(controller, animated: true) } } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }