[Super Clipboard][iOS] - Swizzle Flutter method to say that we can paste even when binary data is on the clipboard #2903
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Super Clipboard][iOS] - Swizzle Flutter method to say that we can paste even when binary data is on the clipboard
We recently implemented image pasting by swizzling Flutter's iOS framework paste method. This successfully let us paste images.
However, Flutter also has a method that answers the question "is there anything to paste?". On the iOS simulator this answers "yes" when pasting images. But on physical iOS devices, this answers "no" when pasting images. The supposed difference is that the simulator saves the image's file path to the clipboard, making it look like string text is available. But on a physical device, only the binary data is saved, so Flutter can't find any strings on the clipboard, and reports "no".
We need to swizzle this additional behavior to say "yes" when there is binary data to paste.