I'm now trying to wrap the native Image Picker (UIImagePickerController), which is working. I'm wondering though, what is the recommended way to push and pop views on and off the screen?
My current code:
@implementationRCTPhotoManagerDelegate
- (void) show:(RCTResponseSenderBlock)callback {
self.done = callback;
_picker = [[UIImagePickerController alloc] init];
_picker.modalPresentationStyle = UIModalPresentationCurrentContext;
_picker.delegate = self;
_picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
dispatch_async(dispatch_get_main_queue(), ^{
UIViewController *root = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
[root presentViewController:_picker animated:YEScompletion:nil];
});
}
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
self.done(@[[NSString stringWithFormat:@"%@", [info valueForKey: @"UIImagePickerControllerReferenceURL"]]]);
[selfdismissViewControllerAnimated:YEScompletion:nil];
}
@endCurrently my popover doesn't actually dismiss, and I feel like this might mess up the React rendering. Is this a bad way to do it?
I'm now trying to wrap the native Image Picker (
UIImagePickerController), which is working. I'm wondering though, what is the recommended way to push and pop views on and off the screen?My current code:
Currently my popover doesn't actually dismiss, and I feel like this might mess up the React rendering. Is this a bad way to do it?