title: How to restrict user from using Rear-Facing Camera in iOS app
body: <p>I am working on an iOS app, in which at one point the user takes a picture. However, I want the user to ONLY be able to use the front facing camera. That is, they should not have access to the rear camera. Currently, my code looks like this:</p>
  
  <pre><code>@IBAction func takePicture(sender: UIButton) {
  
      if UIImagePickerController.availableCaptureModesForCameraDevice(.Front) != nil {
          let imagePickerController = UIImagePickerController()
          imagePickerController.sourceType = .Camera
          imagePickerController.allowsEditing = false
          imagePickerController.cameraDevice = .Front
          imagePickerController.delegate = self
          presentViewController(imagePickerController, animated: true, completion: nil)
      }
      else {
          let alertVC = UIAlertController(
              title: "No Camera",
              message: "Sorry, this device has no camera",
              preferredStyle: .Alert)
          let okAction = UIAlertAction(
              title: "OK",
              style:.Default,
              handler: nil)
          alertVC.addAction(okAction)
          presentViewController(alertVC,
                                animated: true,
                                completion: nil)
      }
  }
  </code></pre>
  
  <p>Although this defaults the camera to be front facing, it still offers users the choice to switch to the rear camera. Is there a way I can restrict this functionality?</p>
  
  <p>Thanks in advance</p>