I have code:
previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
[previewLayer setBackgroundColor:[[UIColor blackColor] CGColor]];
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
CALayer *rootLayer = [self.previewView layer];
[rootLayer setMasksToBounds:NO];
[previewLayer setFrame:CGRectMake([rootLayer bounds].origin.x, [rootLayer bounds].origin.y-20, [rootLayer bounds].size.width, [rootLayer bounds].size.height+40)];
[rootLayer addSublayer:previewLayer];
[previewLayer setBounds:previewLayer.frame];
[session startRunning];
When I start capture image, splash white view shifts to top on 20px (status bar height). And snaped picture has wrong frame (-20 to top and 20 to down or on top is right and -20px down). Actual previewImage frame is
CGRectMake(15, 59, 290, 200).
Now its capturing image (white splash view) in frame CGRect = (15, 59, 290, 170). But snaped image has frame like CGRect = (15, 59, 290, 230). What I'm doing wrong? Please help..