From 000c09a2ccb0b6ebab871b7fbfbfaa6f57f5f483 Mon Sep 17 00:00:00 2001 From: Roman Mandryk Date: Sat, 24 Sep 2016 21:18:41 +0800 Subject: [PATCH] Fix for issue #386 - camera cras- ios 10 simulator --- ios/RCTCameraManager.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/RCTCameraManager.m b/ios/RCTCameraManager.m index c85cbf0..3403ab1 100644 --- a/ios/RCTCameraManager.m +++ b/ios/RCTCameraManager.m @@ -30,10 +30,11 @@ RCT_EXPORT_MODULE(); - (UIView *)view { self.session = [AVCaptureSession new]; - - self.previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.session]; - self.previewLayer.needsDisplayOnBoundsChange = YES; - + #if !(TARGET_IPHONE_SIMULATOR) + self.previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.session]; + self.previewLayer.needsDisplayOnBoundsChange = YES; + #endif + if(!self.camera){ self.camera = [[RCTCamera alloc] initWithManager:self bridge:self.bridge]; }