ios - How to update UIWindow based on changes to another UIWindow? -


the situation arises when iphone/ipad connected external display.

in normal situation, entire device's screen gets mirrored external display. but, need screen on external display display content different in device, specific view/page.

i have uiimageview inside uiscrollview, , related buttons (next, previous, etc) part of specific view controller of app. want external device display content in uiscrollview (that is, buttons not shown). this, seems have create instance of uiwindow external display screen.

but, how can make uiwindow (and it's content) in external display respond correspondingly changes made main uiwindow (the 1 displayed in iphone/ipad). is, changes zooming in , zooming out.

you can somthing this:

- (void)checkforexistingscreenandinitializeifpresent {     if ([[uiscreen screens] count] > 1)     {         // screen object represents external display.         uiscreen *secondscreen = [[uiscreen screens] objectatindex:1];         // screen's bounds can create window of correct size.         cgrect screenbounds = secondscreen.bounds;          self.secondwindow = [[uiwindow alloc] initwithframe:screenbounds];         self.secondwindow.screen = secondscreen;          // set initial content display...         secondwindow.rootviewcontroller = [externalscreenviewcontroller sharedexternalscreen];          // show window.         self.secondwindow.hidden = no;     } } 

now need create externalscreenviewcontroller uiview fills entire viewcontroller. set view of target equal view of scrollview.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -