Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
I want to be able to present the camera on my view, but am having some issues. Is it better to use uiimagepickercontroller, or is there a better method? I simply am trying to emulate look of FaceTime, but it ceases if I try to alloc initwithframe, or instead of presenting the view in a modal controller adding as subview to current view. Is there a better way to do this?
 
You can set an overlay view on UIImagePickerController. This way you can show the picker controller as you normally would but provide a custom overlay view that will shown on top.

If you want more control than UIImagePickerController offers you'll need to look at AVFoundation, specifically the AVCaptureSession and AVCaptureVideoPreviewLayer.
 
I'm not talking about showing an overlay view...I'm talking about showing the camera in a small corner of the uiview, to emulate how FaceTime looks.
 
You're going to have to dive into AVFoundation (and the classes I listed in my previous post) to pull that off. The UIImagPickerController is designed to be shown full screen - even with an overlay view.

You should be able to use the AVCaptureVideoPreviewLayer to create a small view that displays video input. You'll want to read up on AVCaptureSession and check out some tutorials. It's not terribly difficult to configure a video input device with an AVCaptureVideoPreviewLayer but if you've never worked with AVFoundation it can quickly become overwhelming.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.