bugfix - support for iOS8 "fetchOptions.fetchLimit"

This commit is contained in:
Ran Greenberg 2016-07-10 15:21:18 +03:00
parent 63f650ef54
commit 2ffbacca08
2 changed files with 7 additions and 3 deletions

View File

@ -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() {

View File

@ -101,7 +101,10 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{
if (!_fetchOptions) {
PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]];
// iOS 9+
if ([fetchOptions respondsToSelector:@selector(fetchLimit)]) {
fetchOptions.fetchLimit = 1;
}
_fetchOptions = fetchOptions;
}
return _fetchOptions;