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
Post a Comment