Allow the user to select and copy text in a TTStyledTextLabel

I'm not sure if this is a Three20 question or general ios/iphone (I'm a noob in both areas.)

I'm currently using TTStyledTextLabel in a table view to render styled content. Now I would like to allow the user to select text and copy it. Checking the source for TTSTyledTextLabel I find this:

#pragma mark -
#pragma mark UIResponderStandardEditActions

- (void)copy:(id)sender {
  NSString* text = _text.rootNode.outerText;
  UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
  [pasteboard setValue:text forPasteboardType:@"public.utf8-plain-text"];
}

Which indicates that the label is ready to help with the actual copying. But I can't figure out how to make it allow for text selection.

Any ideas anyone?

Answers


Revisiting this years later... This isn't possible without rewriting the TTStyledText classes substantially.


Need Your Help

Error when trying to install Buildr-as3 on Windows 7

windows-7 buildr buildr-extension

I'm currently looking into automating a flex build so that we can get it running on a CI server.

cannot append Model.objects.all()

python django django-models django-queryset

I cannot run ['abc'].append( MyModel.objects.all() ) since it generates exception 'NoneType' object is not iterable if MyModel has no entry.