ViewController.swift 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // ViewController.swift
  3. // QuickSearchLocation
  4. //
  5. // Created by mac on 2024/4/10.
  6. //
  7. import UIKit
  8. class ViewController: UIViewController {
  9. override func viewDidLoad() {
  10. super.viewDidLoad()
  11. self.intoMain()
  12. }
  13. func intoMain() {
  14. QSLBaseManager.shared.initConfig()
  15. // 是否通过引导页
  16. let isShowGuideKey = UserDefaults.standard.bool(forKey: "isShowGuideKey")
  17. if !isShowGuideKey {
  18. // 引导页
  19. UserDefaults.standard.set(true, forKey: "isShowGuideKey")
  20. if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
  21. sceneDelegate.window?.rootViewController = QSLGuideController()
  22. sceneDelegate.window?.makeKeyAndVisible()
  23. }
  24. } else {
  25. if(!QSLBaseManager.shared.isLoadG){
  26. QSLBaseManager.shared.initIDFA()
  27. }
  28. // 主页
  29. if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
  30. sceneDelegate.window?.rootViewController = CustomTabBarController()
  31. sceneDelegate.window?.makeKeyAndVisible()
  32. }
  33. }
  34. }
  35. // 用户协议跳转
  36. func agreementAction() {
  37. let vc = QSLWebViewController()
  38. vc.webUrl = QSLConfig.AppServiceAgreementLink
  39. vc.title = "用户协议"
  40. vc.isShowTop = true
  41. self.present(vc, animated: true)
  42. }
  43. // 隐私协议跳转
  44. func privacyAction() {
  45. let vc = QSLWebViewController()
  46. vc.webUrl = QSLConfig.AppPrivacyAgreementLink
  47. vc.title = "隐私政策"
  48. vc.isShowTop = true
  49. self.present(vc, animated: true)
  50. }
  51. }