| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // ViewController.swift
- // QuickSearchLocation
- //
- // Created by mac on 2024/4/10.
- //
- import UIKit
- class ViewController: UIViewController {
- override func viewDidLoad() {
- super.viewDidLoad()
- self.intoMain()
- }
-
- func intoMain() {
-
- QSLBaseManager.shared.initConfig()
-
- // 是否通过引导页
- let isShowGuideKey = UserDefaults.standard.bool(forKey: "isShowGuideKey")
- if !isShowGuideKey {
- // 引导页
- UserDefaults.standard.set(true, forKey: "isShowGuideKey")
- if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
- sceneDelegate.window?.rootViewController = QSLGuideController()
- sceneDelegate.window?.makeKeyAndVisible()
- }
- } else {
- UNUserNotificationCenter.current().requestAuthorization(
- options: [.alert, .sound, .badge]
- ) { granted, error in
- DispatchQueue.main.async {
- if granted {
- DispatchQueue.main.async {
- UIApplication.shared.registerForRemoteNotifications()
- }
- } else if let error = error {
- print("Error: \(error.localizedDescription)")
- }
- }
- }
-
- if(!QSLBaseManager.shared.isLoadG){
- QSLBaseManager.shared.initIDFA()
- }
- // 主页
- if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
- sceneDelegate.window?.rootViewController = CustomTabBarController()
- sceneDelegate.window?.makeKeyAndVisible()
- }
- }
-
- }
-
- // 用户协议跳转
- func agreementAction() {
-
- let vc = QSLWebViewController()
- vc.webUrl = QSLConfig.AppServiceAgreementLink
- vc.title = "用户协议"
- vc.isShowTop = true
- self.present(vc, animated: true)
- }
-
- // 隐私协议跳转
- func privacyAction() {
-
- let vc = QSLWebViewController()
- vc.webUrl = QSLConfig.AppPrivacyAgreementLink
- vc.title = "隐私政策"
- vc.isShowTop = true
- self.present(vc, animated: true)
- }
- }
|