I want to create focus functionality just like the native camera app using AVCam, but unable to create the same. i am using the above code:
if ([[[captureManager videoInput] device] isFocusPointOfInterestSupported]) {
CGPoint tapPoint = [tgr locationInView:[self videoPreviewView]];
CGPoint convertedFocusPoint = [self convertToPointOfInterestFromViewCoordinates:tapPoint];
[self addLayoutsOfAutoFocus:tapPoint];
[USERDEFAULTS setValue:[NSString stringWithFormat:@"%f",convertedFocusPoint.x] forKey:x_value];
[USERDEFAULTS setValue:[NSString stringWithFormat:@"%f",convertedFocusPoint.y] forKey:y_value];
[USERDEFAULTS synchronize];
[captureManager continuousFocusAtPoint:convertedFocusPoint];
[captureManager continuousExpousureAtPoint:convertedFocusPoint];
}
i am trying to save the focus point, but next time when i reload the camera the focus is lost.
Please help.