ios - UISplitView: Dismiss another popover when splitview popover is presented -
i have problem on ipad application using uisplitview. basically, have button toggles popover (different basic splitview popover). image might explain problem better: problem there in portrait mode.
there 2 cases possible:
first tap on "folders" button, second tap on "settings cogwheel" button, works there: 1 popover shows @ time, because know how register action on settings button.
first tap on "settings" button, second 1 on "folders" button. in case don't know how dismiss "settings" popover, because don't know how register touch on default button made available splitview. (that's problem on picture)
do know how handle touch event on default "folders" button offered splitview?
fixed it! there's delegate method called splitview when popover going present view controller, here is:
//------------------------------------------------------------------------------------- // splitviewcontroller:popovercontroller:willpresentviewcontroller: //------------------------------------------------------------------------------------- - (void)splitviewcontroller:(uisplitviewcontroller *)svc popovercontroller:(uipopovercontroller *)pc willpresentviewcontroller:(uiviewcontroller *)aviewcontroller { [self.popoversettings dismisspopoveranimated:yes]; //dismiss other popover here }
apple's documentation here
Comments
Post a Comment