-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add iOS support #103
base: master
Are you sure you want to change the base?
Add iOS support #103
Conversation
I did not touch the image functions, but I could take a look at it if needed. |
If its reasonable for you, I would prefer to support images on iOS out-of-the-gate as well, since it appears to be supported in the name of preventing cross-platform feature/support drift. I've seen plenty of apps utilize it so I can see this as being something that bites someone. |
src/platform/apple.rs
Outdated
let _: usize = unsafe { msg_send![self.pasteboard, clearContents] }; | ||
#[cfg(target_os = "ios")] | ||
let _: () = unsafe { | ||
msg_send![self.pasteboard, setItems: NSArray::from_vec(Vec::<Id<NSString>>::new())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right array type to clear any existing content type? The docs seem to say this is essentially an array of [String; Any]
but its unclear if this matches. At a glance, this needs an inner dictionary type instead of a plain NSString
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type here doesn't really matter, I just want to send an empty array to the items
property.
It is indeed technically wrong, so I'll push a fix.
#[cfg(target_os = "ios")] | ||
let success: bool = { | ||
let string = NSString::from_str(&data); | ||
unsafe { msg_send![self.clipboard.pasteboard, setString: string] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this (and other callsites) get mixed up? setString
appears to be only a method on NSPasteboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setString
is the objc way of setting a value for the string property, same as setItems.
@complexspaces I just pushed the iOS image implementation. I had to use PNG instead of TIFF format though. |
Is there anything preventing this being merged? I’m sure lots of people would like to see it added. I’m happy to help if I can. |
Hi @rizerco, there's still interest in merging this one in but its fallen off my priority list. Previously I was trying to see if there was a way to convert a |
anything else i can do? |
Thank you for your offer. I am coming up with a plan to resolve conflicts and try testing out the changes here. I'm interested in getting iOS support landed because it would get 1Password closer to using |
Hi again, I have a short status/transparency update: I believe I've finished rebasing/porting to the latest |
Awesome! On the Tauri side we also use a custom Swift implementation 😅 |
No description provided.