Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change picker to Finder for import when running on macOS #5

Open
wants to merge 5 commits into
base: rma-androidx-33
Choose a base branch
from

Conversation

johuether
Copy link

When running on macOS as an emulated iOS app we can use the Finder for picking image.

Till now the user could only chose from images in Apple Photos.

Now the user can chose from the whole filesystem. (But only files with image extension)

Copy link

@sebastian-student sebastian-student left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see any critical problems.

@@ -459,56 +470,99 @@ - (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPic
return data;
}

- (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results API_AVAILABLE(ios(14)) {
- (void)documentPicker:(UIDocumentPickerViewController *)controller
didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls; {
__weak CDVCamera* weakSelf = self;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't used anywhere.

[self sendErrorResultWithMessage];
}

- (void)sendErrorResultWithMessage {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does more than the naming implies. More like onEndSelectionWithoutImage. And use it also in other instances (e.g. insisde picker:didFinishPicking:)


- (void)handleImageFromPicker:(UIImage *)original withData:(NSData *)data {

__weak CDVCamera* weakSelf = self;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weak reference is unncessary at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants