Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7089855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:58:23+00:00 2026-05-28T07:58:23+00:00

I am bringing up the camera with the following code from my ViewController: –

  • 0

I am bringing up the camera with the following code from my ViewController:

- (void)viewDidLoad {
    self.imgPicker = [[UIImagePickerController alloc] init];
    self.imgPicker.sourceType = UIImagePickerControllerCameraDeviceFront;
    self.imgPicker.delegate = self;     
}

- (IBAction)grabCamera {
    [self presentModalViewController:self.imgPicker animated:YES];
}

How can I make it so the camera by default uses the front camera of the iPhone4 and not the back camera?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:58:23+00:00Added an answer on May 28, 2026 at 7:58 am

    UIImagePickerControllerCameraDeviceFront is not a valid enum for the sourceType property. The sourceType property defines whether you’re using the camera or the photo library. You need to set the cameraDevice property instead.

    Objective-C

    self.imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    self.imgPicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
    

    Swift 2

    imgPicker.sourceType = .Camera
    imgPicker.cameraDevice = .Front
    

    Swift 3

    imgPicker.sourceType = .camera
    imgPicker.cameraDevice = .front
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this following code for bringing page attachments to the user: private void
I'm working on bringing some old code from 1998 up to the 21st century.
I am bringing out a separate question from here . It really confused me.
Where can I find a list of transitions for bringing a new Viewcontroller onto
I've inherited some windows-mobile code that I've been bringing up-to-date. I've come across a
I am trying to do a file upload from gwt-ext without bringing up the
I'm getting a html snippet from json that I'm bringing into my template, but
I'm having trouble bringing back data from my PHP file. I guess I don't
While bringing an application from .NET 3.5 to .NET 4.0 I've run into this
Lately, bringing the help window from Visual Studio is taking a long time. Even

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.