AppUtils.swift 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // appUtil.swift
  3. // trtcScenesDemo
  4. //
  5. // Created by xcoderliu on 12/24/19.
  6. // Copyright © 2019 xcoderliu. All rights reserved.
  7. //
  8. // 用于TRTC_SceneDemo
  9. import UIKit
  10. import ImSDK_Plus
  11. //推送证书 ID
  12. #if DEBUG
  13. let timSdkBusiId: UInt32 = 18069
  14. #else
  15. let timSdkBusiId: UInt32 = 18070
  16. #endif
  17. class AppUtils: NSObject {
  18. @objc public static let shared = AppUtils()
  19. private override init() {}
  20. @objc var appDelegate: AppDelegate {
  21. return UIApplication.shared.delegate as! AppDelegate
  22. }
  23. @objc var curUserId: String {
  24. get {
  25. #if NOT_LOGIN
  26. return ""
  27. #else
  28. return V2TIMManager.sharedInstance()?.getLoginUser() ?? ""
  29. #endif
  30. }
  31. }
  32. //MARK: - UI
  33. @objc func showMainController() {
  34. appDelegate.showMainViewController()
  35. }
  36. @objc func alertUserTips(_ vc: UIViewController) {
  37. // 提醒用户不要用Demo App来做违法的事情
  38. // 外发代码不需要提示
  39. }
  40. }