Question

I found an easy way to display the camera feed, but it shows above my XIB. How can I put the feed in a View to display under the buttons and background?

Here's my code.

//ViewController.m

FaceCamViewer *viewer3 = [[FaceCamViewer alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
viewer3.cameraType = AVCaptureDevicePositionFront;

AVCaptureSession *session = [[AVCaptureSession alloc] init];
viewer3.session = session; 

viewer3.draggable = NO;

[viewer3 startFaceCam];
[self.view addSubview:viewer3];

How do I create a property to access this through the XIB?

https://github.com/ijason/FaceCamTest

Was it helpful?

Solution

You could add a simple UIView to your XIB file, place it where you like and create a property that belongs to it. (@property IBOutlet UIView *faceView;) Hook up the property with the View in Interface Builder and then do [self.faceView addSubview:viewer3];

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top