ios - dismissViewControllerAnimated didn't work if monitor is connected -
i have main view controller , use these following code show next view , dismiss view.they working if there no external monitor attached. if attached, can't dismiss view controller although can present view controller. how shall do?
[[[[uiapplication sharedapplication] keywindow] rootviewcontroller] presentmodalviewcontroller:navcontroller animated:yes]; [[[[uiapplication sharedapplication] keywindow] rootviewcontroller] dismissviewcontrolleranimated:yes completion:null];
this external monitor view.
externaldisplayhandler = [[externaldisplayhandler alloc] init]; externaldisplayhandler.delegate = self; if(externaldisplayhandler.monitorexists) { //other code nslog(@"externaldisplayhandler.monitorexists"); [externaldisplayhandler.contentview addsubview:viewonmonitor]; nslog(@"tv attached"); }
i remember there other ways too. change combination.
[self presentviewcontroller:lmvc animated:yes completion:nil]; [self.presentingviewcontroller dismissviewcontrolleranimated:yes completion:nil];
Comments
Post a Comment