snapshotViewAfterScreenUpdate causes view frame to jump

Originator:justinohms
Number:rdar://16288637 Date Originated:2014-03-11
Status:Open Resolved:
Product:iOS SDK Product Version:7.1
Classification: Reproducible:Always
 
Summary:
When calling [self.view snapshotViewAfterScreenUpdates:YES]  in an iPhone targeted app running on an iPad mini.  All views are temporarily misaligned immediately following the call.  This causes a very noticeable "flicker".  This behavior does not happen if the app is targeted to the iPad.  It does happen in the simulator and on an iPad mini.

Steps to Reproduce:
1. Open xCode and create a new single view iPhone project.
2. Create a button on the view
3. Drag click from the button to the companion editor to create an IBAction in the view controller .h file.  (name this "testPress")
4. Open the view controller .m file 
5. Add the following code to the "testPress" block:

//------------------------------------------------------------
  UIView *testView =  [self.view snapshotViewAfterScreenUpdates:YES];
   
    NSLog(@"Self View: %@", self.view);
    NSLog(@"Test View: %@", testView);
    
    //Insert break point here
//------------------------------------------------------------

6. Insert the break point as noted in the code block.
7. Run the project on the iPad simulator or on an iPad 


See attached project for demonstration of this but.

Expected Results:
No visual change should be observed with this code.  When stopping on the break point the screen should be no different than when the application was started.

Actual Results:
In portrait mode the view is offset down and to the right about 80pts.

Version:
 iOS 7.1 (11d5145e) with XCode Version 5.1 (5B103i)

Notes:

Note this will reproduce if running an iPhone targeted app in the iPad simulator.

Retested
This problem still occurs on iOS 7.1 (11d5145e) with XCode Version 5.1 (5B103i)

Update to rdar://15909891 


Configuration:
 iOS 7.1 (11d5145e) with XCode Version 5.1 (5B103i), iPad Mini

Attachments:
'ViewSnapshotTest5.1.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!