-
Notifications
You must be signed in to change notification settings - Fork 195
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
UIMenuController with copy action #58
base: master
Are you sure you want to change the base?
Conversation
…g for token - it will be used to get the real value for copying
@ayanonagon, Hi, can you have a look at this PR? :) |
Thank you for the PR! This is cool. Do you think the delegate method might be more clearly named as |
@ayanonagon Hi! Thanks for watching my PR. I've already tried to name this method as copyString:, but there was a problem with VENToken interface - it cannot have a copyString property, because copy a reserved system prefix. |
@ayanonagon I've added the default value for copying and renamed all methods and properties from underlyingString to copyString. Have a look please. |
@@ -57,6 +61,11 @@ - (void)setTitleText:(NSString *)text | |||
[self.titleLabel sizeToFit]; | |||
} | |||
|
|||
- (void)setTokenCopyString:(NSString *)string | |||
{ | |||
self.tokenCopyString = 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.
This will cause an infinite loop! ♻️
Hi, sorry about the delay. Finally getting to catch up on some PR’s. I just tried this out and got stuck in an infinite loop. Thanks for the PR! |
This pull request provides the ability to copy the value from the selected token.
Full description:
When the user long presses the token a UIMenuController is shown with one action - copy. You can specify what exactly would be copied using the new method from the VENTokenFieldDataSource protocol. It is useful, for example, when your tokens represent contacts email-addresses, but the actual text is the contact's username.
Besides it, as we added the UILongPressGestureRecognizer to the VENToken, I decided to give the user opportunity to add its own longPressBlock, if for some reasons he doesn't want to use the menu controller functionality.
And, of course, I've updated the README file.