ios - iPhone app on iPad: drawViewHierarchyInRect causes glitch -


running iphone app on ipad (ios 8), using drawviewhierarchyinrect take snapshot , custom animation between 2 view controllers. runs fine on iphones when app on ipad (not universal app, iphone only) can see brief glimpse of bad snapshot when animation starts. seems take snapshot of whole ipad screen, including black edges, rather simulated iphone screen. app hides status bar can see status bar in brief glimpse means it's kind of bug in ios ipad shows status bar iphone apps @ top of screen.

here's snapshot code;

uigraphicsbeginimagecontextwithoptions(view.bounds.size, no, 0.0); [view drawviewhierarchyinrect:view.bounds afterscreenupdates:update]; uiimage *snapshotimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); 

incidentally flash occurs when using airplay show app on apple tv.

replace code below,

uigraphicsbeginimagecontextwithoptions(self.view.bounds.size, no, 0); [self.view.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *im = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); 

Comments