LaunchVC.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // LaunchVC.swift
  3. // QuJingApp
  4. //
  5. // Created by 方楚豪 on 2022/5/18.
  6. //
  7. import UIKit
  8. import MMKV
  9. class LaunchVC: UIViewController {
  10. var mmkv:MMKV = MMKV.default()!
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13. // Do any additional setup after loading the view.
  14. let result = mmkv.bool(forKey: AgreementVC.ENTER_KEY, defaultValue: false)
  15. if result {
  16. DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
  17. //show main vc
  18. AppUtils.shared.showMainController()
  19. }
  20. }else {
  21. //实例化一个将要跳转的viewControlleru
  22. let agreementVC = AgreementVC()
  23. let controller = self.storyboard?.instantiateViewController(withIdentifier: String(describing: type(of: agreementVC)))
  24. as! AgreementVC
  25. self.navigationController?.pushViewController(controller, animated: true)
  26. }
  27. }
  28. /*
  29. // MARK: - Navigation
  30. // In a storyboard-based application, you will often want to do a little preparation before navigation
  31. override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  32. // Get the new view controller using segue.destination.
  33. // Pass the selected object to the new view controller.
  34. }
  35. */
  36. }