UserAgreementViewController.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // UserAgreementViewController.swift
  3. // TXLiteAVDemo
  4. //
  5. // Created by lijie on 2020/6/23.
  6. // Copyright © 2020 Tencent. All rights reserved.
  7. //
  8. import UIKit
  9. class UserAgreementViewController: UIViewController {
  10. static let UserAgreeKey = "UserAgreeKey"
  11. typealias Completion = () -> Void
  12. var completion: Completion? = nil
  13. var topPadding: CGFloat = {
  14. if #available(iOS 11.0, *) {
  15. if let window = SceneDelegate.getCurrentWindow() {
  16. return window.safeAreaInsets.top
  17. }
  18. return 0
  19. }
  20. return 0
  21. }()
  22. var bottomPadding: CGFloat = {
  23. if #available(iOS 11.0, *) {
  24. if let window = SceneDelegate.getCurrentWindow() {
  25. return window.safeAreaInsets.top
  26. }
  27. return 0
  28. }
  29. return 0
  30. }()
  31. static func isAgree() -> Bool {
  32. if let isAgree = UserDefaults.standard.object(forKey: UserAgreeKey) as? Bool {
  33. return isAgree
  34. }
  35. return false
  36. }
  37. override func viewDidLoad() {
  38. super.viewDidLoad()
  39. setupUI()
  40. }
  41. deinit {
  42. debugPrint("deinit \(self)")
  43. }
  44. }