Swift, camera in landscape mode
<p>I am using this tutorial but I has a problem when in the applicaction target unmark portrait, simulating my application thats works only in landscape.</p>

<p>How I can configure this camera in order thats works only in landscape.</p>

<p><a href="https://github.com/deege/deegeu-swift-camera-basic" rel="nofollow">https://github.com/deege/deegeu-swift-camera-basic</a></p>

<p><a href="https://www.dropbox.com/s/jnfwhi9s6zm30ns/Captura%20de%20pantalla%202016-05-12%2011.48.19.png?dl=0" rel="nofollow">https://www.dropbox.com/s/jnfwhi9s6zm30ns/Captura%20de%20pantalla%202016-05-12%2011.48.19.png?dl=0</a></p>

<p>Code, you can download the project for obtain the code:</p>

<pre><code>// 
//  ViewController.swift 
//  swift-camera-basic 
// 
//  Created by Daniel Spiess on 10/16/15. 
//  Copyright © 2015 Daniel Spiess. All rights reserved. 
//

import UIKit

class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

    @IBOutlet weak var currentImage: UIImageView!


    let imagePicker: UIImagePickerController! = UIImagePickerController()

    override func viewDidLoad() {
        super.viewDidLoad()

        // Set this controller as the camera delegate
        imagePicker.delegate = self
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    @IBAction func takePicture(sender: UIButton) {
        if (UIImagePickerController.isSourceTypeAvailable(.Camera)) {
            if UIImagePickerController.availableCaptureModesForCameraDevice(.Rear) != nil {
                imagePicker.allowsEditing = false
                imagePicker.sourceType = .Camera
                imagePicker.cameraCaptureMode = .Photo
                presentViewController(imagePicker, animated: true, completion: {})
            } else {
                postAlert("Rear camera doesn't exist", message: "Application cannot access the camera.")
            }
        } else {
            postAlert("Camera inaccessable", message: "Application cannot access the camera.")
        }
    }

    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
        print("Got an image")
        if let pickedImage:UIImage = (info[UIImagePickerControllerOriginalImage]) as? UIImage {
            let selectorToCall = Selector("imageWasSavedSuccessfully:didFinishSavingWithError:context:")
            UIImageWriteToSavedPhotosAlbum(pickedImage, self, selectorToCall, nil)
        }
        imagePicker.dismissViewControllerAnimated(true, completion: {
            // Anything you want to happen when the user saves an image
        })
    }

    func imagePickerControllerDidCancel(picker: UIImagePickerController) {
        print("User canceled image")
        dismissViewControllerAnimated(true, completion: {
            // Anything you want to happen when the user selects cancel
        })
    }

    func imageWasSavedSuccessfully(image: UIImage, didFinishSavingWithError error: NSError!, context: UnsafeMutablePointer&lt;()&gt;){
        print("Image saved")
        if let theError = error {
            print("An error happened while saving the image = \(theError)")
        } else {
            print("Displaying")
            dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
                self.currentImage.image = image
            })
        }
    }

    func postAlert(title: String, message: String) {
        let alert = UIAlertController(title: title, message: message,
            preferredStyle: UIAlertControllerStyle.Alert)
        alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
        self.presentViewController(alert, animated: true, completion: nil)
    } }
</code></pre>