Skip to content

Sample project demonstrating how you can display the pasteboard menu on an UILabel.

Notifications You must be signed in to change notification settings

Iragne/UILabel-Clipboard-Sample

 
 

Repository files navigation

CopyLabel: UILabel on steroids

This version of CopyLabel adds additional functionality to zoul's original repo:

  • The code uses ARC. If you're using this code in a non-ARC project, make sure to add -fobjc-arc to the compiler flags of CopyLabel.m
  • When highlightedTextColor is set, the entire label highlights when the menu is visible
  • By default, the label copies its text to the clipboard. However, you can set a custom copy action by calling - (void)setTarget:(id)target forCopyAction:(SEL)action;. This functionality is demonstrated in the sample project.

Original Readme by zoul

This is a simple project demonstrating how you can display the system pasteboard menu on a regular UILabel. The interesting code is in the CopyLabel.m class. Originally motivated by this question on Stack Overflow. Released to public domain under the CC0 license.

About

Sample project demonstrating how you can display the pasteboard menu on an UILabel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%