FXForms
FXForms copied to clipboard
When selecting cancel in image field's action sheet, it opens photo library image picker
It opens UIImagePickerControllerSourceTypePhotoLibrary even if the user selects Cancel button. line:3476 in FXForms.m
- (void)actionSheet:(__unused UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
switch (buttonIndex)
{
case 0:
{
sourceType = UIImagePickerControllerSourceTypeCamera;
break;
}
case 1:
{
sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
break;
}
}
if ([UIImagePickerController isSourceTypeAvailable:sourceType])
{
self.imagePickerController.sourceType = sourceType;
[self.controller presentViewController:self.imagePickerController animated:YES completion:nil];
}
self.controller = nil;
}
Should be something like:
- (void)actionSheet:(__unused UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex != 2) {
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
switch (buttonIndex)
{
case 0:
{
sourceType = UIImagePickerControllerSourceTypeCamera;
break;
}
case 1:
{
sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
break;
}
}
if ([UIImagePickerController isSourceTypeAvailable:sourceType])
{
self.imagePickerController.sourceType = sourceType;
[self.controller presentViewController:self.imagePickerController animated:YES completion:nil];
}
self.controller = nil;
}
}
+1 I am having the same issue.