AVCaptureVideoOrientation+Extension.swift 669 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // AVCaptureVideoOrientation+Extension.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2018/10/16.
  6. // Copyright © 2018 zoneland. All rights reserved.
  7. //
  8. import Foundation
  9. extension AVCaptureVideoOrientation {
  10. static func transform(ui: UIInterfaceOrientation) -> AVCaptureVideoOrientation {
  11. switch ui {
  12. case .landscapeLeft:
  13. return .landscapeLeft
  14. case .landscapeRight:
  15. return .landscapeRight
  16. case .portrait:
  17. return .portrait
  18. case .portraitUpsideDown:
  19. return .portraitUpsideDown
  20. default:
  21. return .portrait
  22. }
  23. }
  24. }