iPhone - Detecting if the iDevice has a front camera -


apple recommends not searching hardware version, specific feature in interested.

so how may detect if there front camera on device able disable features ?

[uiimagepickercontroller issourcetypeavailable: uiimagepickercontrollersourcetypecamera] tells there camera somewhere.

try method of uiimagepickercontroller:

+ (bool)iscameradeviceavailable:(uiimagepickercontrollercameradevice)cameradevice

this class method , uiimagepickercontrollercameradevice can take 2 values:

  • uiimagepickercontrollercameradevicerear
  • uiimagepickercontrollercameradevicefront

example code:

if( [uiimagepickercontroller iscameradeviceavailable: uiimagepickercontrollercameradevicefront ]) {    // } 

note available ios 4.0 , later.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -