Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 569 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show iPhone cut copy paste menu on UILabel

#11
The [sample project on github][1] due to @zoul's answer is the way to go. At the time of this writing, that project does not actually put anything on the clipboard (pasteboard). here is how:

Change @zoul's implementation of this method to:

- (void) copy:(id)sender {
UIPasteboard *pboard = [UIPasteboard generalPasteboard];
pboard.string = self.text;
}


[1]:

[To see links please register here]

Reply

#12
I got the copy & paste menu working on a `UILabel`, I just had to return `YES` for `canBecomeFirstResponder` and later call `[label becomeFirstResponder]` when the said label was to come on screen. As for returning `YES` from `canBecomeFirstResponder`, you can create a custom subclass or patch `UILabel` using a category:

@implementation UILabel (Clipboard)

- (BOOL) canBecomeFirstResponder
{
return YES;
}

@end

The category solution feels a bit hackish, but if you know what you’re doing it might be easier than subclassing. I have also put up a [sample project on GitHub][1] that shows how to display a simple pasteboard menu on an `UILabel`.


[1]:

[To see links please register here]

Reply

#13
Override the `UITextField` instance's `textFieldShouldBeginEditing` method, and set it to return `NO` in order to disable editing.

Take a look at the [`UITextFieldDelegate`][1] protocol for more details.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through