title: AVFoundation tap to focus feedback rectangle
body: <p>I am developing an iphone application where I directly use AVFoundation to capture videos via the camera. </p>
  
  <p>I've implemented a feature to enable the <code>tap to focus</code> function for a user. </p>
  
  <pre><code>- (void) focus:(CGPoint) aPoint;
  {
  #if HAS_AVFF
      Class captureDeviceClass = NSClassFromString(@"AVCaptureDevice");
      if (captureDeviceClass != nil) {        
          AVCaptureDevice *device = [captureDeviceClass defaultDeviceWithMediaType:AVMediaTypeVideo];
          if([device isFocusPointOfInterestSupported] &amp;&amp;
             [device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
              CGRect screenRect = [[UIScreen mainScreen] bounds];
              double screenWidth = screenRect.size.width;
              double screenHeight = screenRect.size.height;
              double focus_x = aPoint.x/screenWidth;
              double focus_y = aPoint.y/screenHeight;
              if([device lockForConfiguration:nil]) {
                  [device setFocusPointOfInterest:CGPointMake(focus_x,focus_y)];
                  [device setFocusMode:AVCaptureFocusModeAutoFocus];
                  if ([device isExposureModeSupported:AVCaptureExposureModeAutoExpose]){
                      [device setExposureMode:AVCaptureExposureModeAutoExpose];
                  }
                  [device unlockForConfiguration];
              }
          }
      }
  #endif
  }
  </code></pre>
  
  <p>So far so good, but I am missing the feedback rectangle like in the photos app. Is there any way to tell the AVFoundation Framework to show this feedback rectangle or do I have to implement this feature myself?</p>