How do you create a UIMenuController for something that is not text based?

The Apple Messages app, along with many other third-party apps, supports a style UIMenuControllerfor selecting messages.

enter image description here

However, when viewing the documentation, it seems that it is used only to highlight text.

Is it possible to spread it to others UIViews?

+3
source share
1 answer

This is part of the tableView delegate API: http://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:shouldShowMenuForRathtowatowat

-(void)tableView:(UITableView*)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender;
-(BOOL)tableView:(UITableView*)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender;
-(BOOL)tableView:(UITableView*)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath*)indexPath; 

, API canPerformAction: responder , UIMenuController.

+2

All Articles