ios - How to call some code if users press back button -


in uinavigationcontroller?

for example, want make sure uinavigationcontroller not animating when user press button.

if aren't intending intercept button tap instead act of current view controller disappearing, can use:

- (void)viewwilldisappear:(bool)animated {     if (self.ismovingfromparentviewcontroller) {         // handle button press     } } 

if sure want button, can create own custom uibarbuttonitem , set current controller's leftbarbuttonitem. sure call [self.navigationcontroller popviewcontrolleranimated:yes] after have finished doing own logic.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -