2

I have a situation where i want to copy the text from UILabel as a default cut/copy menu which appears in iPhone.I know that i can use a UITextField for enabling this menu but the key pad pops up and when i make the editing to return no,the keypad is not showing up and the default copy/cut menu is also not showing up.

I tried to use UITextView and unchecked the diting property in the properties of the UITextView,but it didn't gave me a proper solution.Because when the font exceeds the UITextView's height. It goes to the next line and it cannot be aligned properly in a view which i have now.

I came across this post "Show iPhone cut copy paste menu on UILabel" in stack overflow itself which says the same functionality which I need.

I downloaded the source code from git but I got 23 errors.

How can implement this ?

Community
  • 1
  • 1
Sankar Chandra Bose
  • 377
  • 1
  • 12
  • 27

2 Answers2

2

This github project is compiled fine and I have tested it it's working

UILabel copy using menu

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
1

You may also want to check out HTCopyableLabel on GitHub. It's a UILabel subclass that makes copying text easy.

codeperson
  • 8,050
  • 5
  • 32
  • 51