RoomKitNavigationController.swift 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // RoomKitNavigationController.swift
  3. // TUIRoomKit
  4. //
  5. // Created by janejntang on 2023/4/20.
  6. //
  7. import Foundation
  8. class RoomKitNavigationController: UINavigationController {
  9. override init(rootViewController: UIViewController) {
  10. super.init(rootViewController: rootViewController)
  11. interactivePopGestureRecognizer?.isEnabled = false
  12. }
  13. required init?(coder aDecoder: NSCoder) {
  14. fatalError("init(coder:) has not been implemented")
  15. }
  16. override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
  17. super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
  18. }
  19. override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
  20. guard let supportedInterfaceOrientations = topViewController?.supportedInterfaceOrientations as? UIInterfaceOrientationMask
  21. else { return .portrait }
  22. return supportedInterfaceOrientations
  23. }
  24. override var shouldAutorotate: Bool {
  25. guard let shouldAutorotate = topViewController?.shouldAutorotate else { return false }
  26. return shouldAutorotate
  27. }
  28. }