feat: Custom Orientation (#715)
* feat: Custom Orientation * Update CameraView.swift * Update CameraView.swift * Try outputRotation approach * whoops * fix: Refactor `VideoCapture` instance * Update orientation in didSetProps * Update Orientation in iOS * expose to objc * Fix Orientation values * format
This commit is contained in:
31
ios/Parsers/UIInterfaceOrientation+descriptor.swift
Normal file
31
ios/Parsers/UIInterfaceOrientation+descriptor.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// UIInterfaceOrientation+descriptor.swift
|
||||
// VisionCamera
|
||||
//
|
||||
// Created by Marc Rousavy on 04.01.22.
|
||||
// Copyright © 2022 mrousavy. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
extension UIInterfaceOrientation {
|
||||
init(withString string: String) throws {
|
||||
switch string {
|
||||
case "portrait":
|
||||
self = .portrait
|
||||
return
|
||||
case "portraitUpsideDown":
|
||||
self = .portraitUpsideDown
|
||||
return
|
||||
case "landscapeLeft":
|
||||
self = .landscapeLeft
|
||||
return
|
||||
case "landscapeRight":
|
||||
self = .landscapeRight
|
||||
return
|
||||
default:
|
||||
throw EnumParserError.invalidValue
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user