I followed a tutorial on taking pictures using AvFoundation Framework.. so i am not proficient in it.. thats one point.
In the app..in the nib. There is a view(SUBVIEW) as a sub view of the main view(MAINVIEW). And there is a an image view and button as a subview of the subview View(SUBVIEW) not the Main view.
There is code in the tutorial (for the subview)
AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
[self.vImagePreview.layer addSublayer:captureVideoPreviewLayer];
but after applying this the image view appears in back of the SUBVIEW not in front of it as it was supposed to in the nib.. So how to get image view appear in front of the view..vimagepreview is the SUBVIEW