For this, first you create a menu with custom items and then listen to UIMenuControllerWillHideMenuNotification
notification. In side this notification when menu is going to hide you can remove the items what you added. Here is the sample code.
-(void) showMenu{
UIMenuController * menuController =[UIMenuController sharedMenuController];
UIMenuItem * item1 = [[UIMenuItem alloc] initWithTitle:@"Goto" action:@selector(menuItem1Clicked:)];
UIMenuItem * item2 = [[UIMenuItem alloc] initWithTitle:@"Edit" action:@selector(menuItem2Clicked:)];
[menuController setMenuItems:@[item, item1]];
[menuController setTargetRect:rect inView:self.view];
[menuController setMenuVisible:YES animated:YES];
}
And when menu is going to hide remove the items you added
-(void) menuControllerWillHide:(NSNotification*)notification
{
UIMenuController * controller = [UIMenuController sharedMenuController];
NSArray * items = [controller menuItems]; // These are all custom items you added
NSMutableArray * finalItemsYouWant = [NSMutableArray array];
// Here you can check what items you dont want and then remove it
[controller setMenuItems:finalItemsYouWant];
}