diff --git a/example/CameraScreen.ios.js b/example/CameraScreen.ios.js index 1d58438..069f151 100644 --- a/example/CameraScreen.ios.js +++ b/example/CameraScreen.ios.js @@ -93,7 +93,7 @@ export default class CameraScreen extends Component { } async onSwitchCameraPressed() { - const success = await this.camera.changeCamera(); + const success = await this.camera.changeCamera(); } async onCheckAuthoPressed() { @@ -107,7 +107,8 @@ export default class CameraScreen extends Component { } async onSetFlash(flashMode) { - const success = await this.camera.setFleshMode(flashMode); + const success = await this.camera.setFlashMode(flashMode); + } async onTakeIt() { diff --git a/ios/lib/ReactNativeCameraKit/CKCamera.m b/ios/lib/ReactNativeCameraKit/CKCamera.m index 704b07a..cf8a3d2 100644 --- a/ios/lib/ReactNativeCameraKit/CKCamera.m +++ b/ios/lib/ReactNativeCameraKit/CKCamera.m @@ -101,7 +101,10 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{ if (!_fetchOptions) { PHFetchOptions *fetchOptions = [PHFetchOptions new]; fetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]]; - fetchOptions.fetchLimit = 1; + // iOS 9+ + if ([fetchOptions respondsToSelector:@selector(fetchLimit)]) { + fetchOptions.fetchLimit = 1; + } _fetchOptions = fetchOptions; } return _fetchOptions;