2014. 11. 18. 18:11 아이폰

ios 오토 포커스 기능 체크 하는 소스 




NSArray *devices = [AVCaptureDevice devices];

    AVCaptureDevice *frontCamera;

    AVCaptureDevice *backCamera;

    

    for (AVCaptureDevice *device in devices) {

        

        DEBUGMSG(@"Device name: %@", [device localizedName]);

     

        if ([device hasMediaType:AVMediaTypeVideo]) {

            

            if ([device position] == AVCaptureDevicePositionBack) {

                DEBUGMSG(@"Device position : back");

                backCamera = device;

            }

            else {

                DEBUGMSG(@"Device position : front");

                frontCamera = device;

            }

        }

    }

    

    if([backCamera isFocusModeSupported:AVCaptureFocusModeAutoFocus])

    {

        

    }else

    {

        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil

                                                        message:@"오토 포커스 기능이 ."

                                                       delegate:nil

                                              cancelButtonTitle:@"ok"

                                            otherButtonTitles:nil];

        [alert show];


    }

    

posted by 욱이다