blob: 8ca2dbc54e066b357e187f17795bae094a52e659 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#import "ContextViews.h"
@implementation CopyLabel
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
self.userInteractionEnabled = YES;
return self;
}
- (BOOL)canBecomeFirstResponder
{
return YES;
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
return action == @selector(copy:);
}
- (void)copy:(id)sender
{
[UIPasteboard generalPasteboard].string = self.text;
}
@end
|