ios - Dismiss navigation controller and all of its view controllers stack in UIPopupview using a button within one of the views -
i displaying uipopoverview using code:
selectclientpopcontroller= [[uipopovercontroller alloc]initwithcontentviewcontroller: [self.storyboard instantiateviewcontrollerwithidentifier:@"navcontrollermini"]]; selectclientpopcontroller.popovercontentsize=cgsizemake(500, 700); selectclientpopcontroller.delegate=self; [selectclientpopcontroller presentpopoverfromrect:cgrectmake(cell.frame.origin.x+120-scrollview.contentoffset.x, cell.frame.origin.y+120,cell.frame.size.width, cell.frame.size.height) inview:self.view permittedarrowdirections:uipopoverarrowdirectionleft | uipopoverarrowdirectionright animated:yes];
this navigation view controller ued step through 2 tableviewcontrollers shown below:
when cell on last tableview pressed, dismiss whole popover. understand needs done using delegates, not know assign delegates in order achieve this. help.
why not
// listen tableview row selection setting delegate. // self if set delegate in same view controller yourtableview.delegate = yourviewcontrollerobjectwhichhastableview; - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ [selectclientpopcontroller dismisspopoveranimated:yes]; }
whenever u need dismiss popover use above method. refer apple's documentation
Comments
Post a Comment