Skip to content

Instantly share code, notes, and snippets.

@b123400
Created April 12, 2011 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b123400/915576 to your computer and use it in GitHub Desktop.
Save b123400/915576 to your computer and use it in GitHub Desktop.
-(id)init{
UIMenuItem *customMenuItem = [[[UIMenuItem alloc] initWithTitle:@"Search" action:@selector(searchWord:)] autorelease];
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObjects:customMenuItem, nil]];
return [super init];
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if (tweetContentView.superview != nil) {
if (action == @selector(searchWord:)) {
return YES;
}
}
return [super canPerformAction:action withSender:sender];
}
-(void)searchWord:(id)sender{
//do things here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment