I want to make twin screen using built-in camera on iOS
I tried following code, but it shows just one view.
It's a natural result, I know.
Here's the code what I used..
- (void)prepareCameraView:(UIView *)window
{
AVCaptureSession *session = [[AVCaptureSession alloc] init];
session.sessionPreset = AVCaptureSessionPresetMedium;
CALayer *viewLayer = window.layer;
NSLog(@"viewLayer = %@", viewLayer);
AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc]
initWithSession:session];
captureVideoPreviewLayer.frame = window.bounds;
[window.layer addSublayer:captureVideoPreviewLayer];
AVCaptureDevice *captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
NSError *error = nil;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:captureDevice error:&error];
if (!input)
{
NSLog(@"ERROR : trying to open camera : %@", error);
}
[session addInput:input];
[session startRunning];
}
How can I get double screen on iOS?