 	public var captureDeviceBack: AVCaptureDevice?
 	private weak var stillImageOutput: AVCaptureStillImageOutput?
 	
-	public var currentOrientation = UIInterfaceOrientation.Portrait
+	public var contentView = UIView()
+	
+	public var originalOrientation = UIDevice.currentDevice().orientation
+	public var currentOrientation = UIDevice.currentDevice().orientation
 	public let motionManager = CMMotionManager()
 	
 	public lazy var flashButton: UIButton = {

	
	// MARK: - Handles Orientation
	
	public func setupMotionManager() {
		self.motionManager.accelerometerUpdateInterval = 0.2
		self.motionManager.gyroUpdateInterval = 0.2
	}
	
	public func outputAccelertionData(acceleration: CMAcceleration) {
		var currentOrientation: UIInterfaceOrientation?
		
		if acceleration.x >= 0.75 {
			currentOrientation = .LandscapeLeft
		} else if acceleration.x <= -0.75 {
			currentOrientation = .LandscapeRight
		} else if acceleration.y <= -0.75 {
			currentOrientation = .Portrait
		} else if acceleration.y >= 0.75 {
			currentOrientation = .PortraitUpsideDown
		} else {
			return
		}
		
		if self.currentOrientation != currentOrientation! {
			self.currentOrientation = currentOrientation!
			
			self.updateUIForCurrentOrientation()
		}
	}
	
	public func updateUIForCurrentOrientation() {
		var degree = 0.0
		
		switch self.currentOrientation {
		case .Portrait:
			degree = 0
		case .PortraitUpsideDown:
			degree = 180
		case .LandscapeLeft:
			degree = 270
		case .LandscapeRight:
			degree = 90
		default:
			degree = 0.0
		}
		
		let rotateAffineTransform = CGAffineTransformRotate(CGAffineTransformIdentity, degreesToRadians(degree))
		
		UIView.animateWithDuration(0.2) { () -> Void in
			self.flashButton.transform = rotateAffineTransform
			self.cameraSwitchButton.transform = rotateAffineTransform
		}
	}
	
	public override func shouldAutorotate() -> Bool {
		return false
	}
	
	public override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
		return UIInterfaceOrientationMask.Portrait
	}
	
}

// MARK: - Utilities

public extension UIInterfaceOrientation {
	
	func toAVCaptureVideoOrientation() -> AVCaptureVideoOrientation {
		return AVCaptureVideoOrientation(rawValue: self.rawValue)!
	}
	
}

public func degreesToRadians(degree: Double) -> CGFloat {
	return CGFloat(degree / 180.0 * M_PI)
}

// MARK: - Rersources

			return
		}
		
		let focusPoint = self.previewLayer.captureDevicePointOfInterestForPoint(touchPoint)
		
		showFocusViewAtPoint(touchPoint)
		
