ios - Recognizing a Tap on the Title in UINavigation Bar -


could please me recognize tap when user taps on title in navigation bar, in objective-c?

try following :

1) add button title view of navigation

uibutton *titlelabelbutton = [uibutton buttonwithtype:uibuttontypecustom]; [titlelabelbutton settitle:@"mytitle" forstate:uicontrolstatenormal]; titlelabelbutton.frame = cgrectmake(0, 0, 70, 44); titlelabelbutton.font = [uifont boldsystemfontofsize:16]; [titlelabelbutton addtarget:self action:@selector(didtaptitleview:) forcontrolevents:uicontroleventtouchupinside]; self.navigationitem.titleview = titlelabelbutton; 

2)implement selector

- (ibaction)didtaptitleview:(id) sender{     //perform actions     nslog(@"title tap"); } 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -