ios - Add a UIMenuItem for a specific UITextView? -


i have lot of uitextviews in screen , want add new custom uimenuitem 1 of them.

it possible add custom uimenuitem specific uitextview?

i use below code have custom button uitextviews

uimenuitem *menuitem = [[uimenuitem alloc] initwithtitle:@"read" action:@selector(readbuttonaction)]; [[uimenucontroller sharedmenucontroller] setmenuitems:[nsarray arraywithobject:menuitem]]; 

thanks

if want uimenuitem displayed specific uitextview can add menuitem in textfielddidbegineditingmethod , add specific tag uitextview custom menu item displayed :-

-(void)textviewdidbeginediting:(uitextview *)textview  {   if(textview.tag==999)  //specify textveiw want custom menu     {   [[nsoperationqueue mainqueue] addoperationwithblock:^{    uimenuitem *menuitem = [[uimenuitem alloc] initwithtitle:@"read" action:@selector(readbuttonaction)];     [[uimenucontroller sharedmenucontroller] setmenuitems:[nsarray arraywithobject:menuitem]];        }];      }  } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -