Adding a custom action to the copy/paste menu

Adding your own action to the copy/paste menu that is displayed when you touch down inside any editable control is pretty easy. Just add the code below to the viewDidLoad method inside your view controller.

UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Add picture" action:@selector(addPicture:)];
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObject:menuItem]];
[menuItem release];
If you liked this post, please click on one of the advertisements below. Thanks!


0 Responses to “IOS Quick Tips: Adding your own action to the copy/paste menu”

  1. No Comments

Leave a Reply


*