Created
April 12, 2011 14:22
-
-
Save b123400/915576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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