mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-03-25 09:05:52 +00:00
Remove protocol for orientation mode
This commit is contained in:
parent
a9746bf861
commit
0c4b65f8aa
2 changed files with 9 additions and 11 deletions
|
|
@ -17,17 +17,11 @@ import Foundation
|
|||
import AVFoundation
|
||||
import UIKit
|
||||
|
||||
protocol Orientation: class {
|
||||
func getPreviewLayerOrientation() -> AVCaptureVideoOrientation
|
||||
func getVideoOrientation() -> AVCaptureVideoOrientation?
|
||||
func getImageOrientation(forCamera: SwiftyCamViewController.CameraSelection) -> UIImageOrientation
|
||||
func start()
|
||||
func stop()
|
||||
}
|
||||
|
||||
class DeviceOrientation : Orientation {
|
||||
var deviceOrientation : UIDeviceOrientation?
|
||||
class Orientation {
|
||||
private var deviceOrientation : UIDeviceOrientation?
|
||||
var shouldUseDeviceOrientation: Bool = false
|
||||
|
||||
|
||||
func start() {
|
||||
self.deviceOrientation = UIDevice.current.orientation
|
||||
|
|
|
|||
|
|
@ -145,7 +145,11 @@ open class SwiftyCamViewController: UIViewController {
|
|||
|
||||
/// Sets wether the taken photo or video should be oriented according to the device orientation
|
||||
|
||||
public var shouldUseDeviceOrientation = false
|
||||
public var shouldUseDeviceOrientation = false {
|
||||
didSet {
|
||||
orientation.shouldUseDeviceOrientation = shouldUseDeviceOrientation
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets whether or not View Controller supports auto rotation
|
||||
|
||||
|
|
@ -245,7 +249,7 @@ open class SwiftyCamViewController: UIViewController {
|
|||
|
||||
/// Last changed orientation
|
||||
|
||||
var orientation : Orientation = DeviceOrientation()
|
||||
var orientation = Orientation()
|
||||
|
||||
/// Boolean to store when View Controller is notified session is running
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue