Remove protocol for orientation mode

This commit is contained in:
Jon Andersen 2017-09-07 17:10:01 -04:00
parent a9746bf861
commit 0c4b65f8aa
2 changed files with 9 additions and 11 deletions

View file

@ -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

View file

@ -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