ios - Switch between two UIWindow's -


i integrating pushwoosh sdk push notification, using uiwindow represent html page sent pushwoosh portal

- (void) showwebview {     self.richpushwindow.alpha = 0.0f;     self.richpushwindow.windowlevel = uiwindowlevelstatusbar + 1.0f;     self.richpushwindow.hidden = no;     self.richpushwindow.transform = cgaffinetransformmakescale(0.01, 0.01);      [uiview animatewithduration:0.3 animations:^{         self.richpushwindow.transform = cgaffinetransformidentity;         self.richpushwindow.alpha = 1.0f;     } completion:^(bool finished) {     }];  }  - (void) showpushpage:(nsstring *)pageid {     nsstring *url = [nsstring stringwithformat:kservicehtmlcontentformaturl, pageid];     htmlwebviewcontroller *vc = [[htmlwebviewcontroller alloc] initwithurlstring:url];     vc.delegate = self;     vc.supportedorientations = supportedorientations;      self.richpushwindow.rootviewcontroller = vc;     [vc view]; } 

and on closing on html page calls

self.richpushwindow.transform = cgaffinetransformidentity; [uiview animatewithduration:0.3 delay:0 options:uiviewanimationoptioncurveeaseout animations:^{     self.richpushwindow.transform = cgaffinetransformmakescale(0.01, 0.01);     self.richpushwindow.alpha = 0.0f;   } completion:^(bool finished) {     appdelegate * appdelegate = (appdelegate*)[[uiapplication sharedapplication] delegate];      self.richpushwindow.hidden = yes;   }]; 

now want call view controller on closing of html page. tried present myviewcotrlller in block completion not presenting.

actually here problem there 2 uiwindows in app 1 of app , other used sdk. if try present view controller html page on separate uiwindow creates separate hierarchy , when close window removes presented viewconroller due parent-child relationship. , if not close window how come actual flow of app.

i want new controller should presented new window , after window should close , flow of app should not affected additional window. possible? if concept wrong, please if has idea

edit: second uiwindow never key window, becomes visible setting higher windowlevel , become hidden

the problem right after completion block richpushwindow gone, means trying present view controller on hidden window.

the solution simple. use main window present view controller. pseudocode:

add view viewcontoller main window subviews:

  1. [appdelegate.window addsubview:myviewcontroller.view];

modal:

  1. [appdelegate.window.rootviewcontroller presentmodalviewcontroller:myviewcontroller]

using view controller hierarchy:

  1. push viewcontroller main viewcontroller stack. example if have navigationcontroller, push there.

i hope helps!


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -