AppDelegate.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // AppDelegate.swift
  3. // JiaPeiManage
  4. //
  5. // Created by Ning.ge on 2023/6/12.
  6. //
  7. import UIKit
  8. @main
  9. class AppDelegate: UIResponder, UIApplicationDelegate {
  10. // MARK: Properties
  11. var dependency: NYAppDependency!
  12. // MARK: UI
  13. var window: UIWindow?
  14. // MARK: UIApplicationDelegate
  15. func application(_ application:UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  16. self.dependency = self.dependency ?? CompositionRoot.resolve()
  17. self.window = self.dependency.window
  18. self.dependency.configureSDKs()
  19. self.dependency.configureAppearance()
  20. self.dependency.configureUserAgent()
  21. self.dependency.congigurePerformance()
  22. LocalManager.autoLogin()
  23. // 设置状态栏颜色
  24. UIApplication.shared.statusBarStyle = .lightContent
  25. return true
  26. }
  27. func applicationDidBecomeActive(_ application: UIApplication) {
  28. let idfa = NYIDFA.getIDFA()
  29. }
  30. func application(
  31. _ app: UIApplication,
  32. open url: URL,
  33. options: [UIApplication.OpenURLOptionsKey: Any] = [:]
  34. ) -> Bool {
  35. return self.dependency.openURL(url, options)
  36. }
  37. }