{"action":"opened","issue":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/7162","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/7162/labels{/name}","comments_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/7162/comments","events_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/7162/events","html_url":"https://github.com/lionheart/openradar-mirror/issues/7162","id":125299130,"number":7162,"title":"23280454: UIKit in iOS 9.1: Calling UIView.snapshotViewAfterScreenUpdates creates a bogus animation","user":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/classification:other%20bug","name":"classification:other bug","color":"e11d21"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/reproducible:always","name":"reproducible:always","color":"5319e7"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/status:open","name":"status:open","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/4","html_url":"https://github.com/lionheart/openradar-mirror/milestones/iOS%20SDK","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/4/labels","id":1237418,"number":4,"title":"iOS SDK","description":null,"creator":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"open_issues":1182,"closed_issues":3,"state":"open","created_at":"2015-08-03T02:08:31Z","updated_at":"2016-01-07T01:02:02Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-01-07T01:02:02Z","updated_at":"2016-01-07T01:02:02Z","closed_at":null,"body":"#### Description\n\nSummary:\nOn iOS 9.1, when I call UIView.snapshotViewAfterScreenUpdates inside a UIView-based animation, the snapshot is erroneously displayed on-screen until the enclosing animation transaction is committed. On iPhone in landscape orientation, the duplicate layer is rotated/scaled to upside-down portrait orientation, then gradually animated in place until it is removed from screen. \n\nAnimation blocks usually finish quickly; however, the bogus layer is often still displayed for a single frame, which, when combined with the landscape animation, leads to visible (and highly unexpected) flickering.\n\nI expect screen contents not to change as a side effect of calling UIView.snapshotViewAfterScreenUpdates at all.\n\nSteps to Reproduce:\n1. Run the attached sample project (on device or in simulator)\n2. Rotate the device to landscape orientation.\n3. Press the on-screen button. The button’s action runs the following code:\n\nUIView.animateWithDuration(1) {\n    view.snapshotViewAfterScreenUpdates(true)\n    sleep(1)\n}\n\nExpected Results:\nThe app freezes for one second with no animation.\n\nActual Results:\nThe view’s contents are duplicated; the duplicate layer is displayed squished in an upside-down portrait orientation, then slowly animated into landscape. This is entirely unexpected.\n\nRemoving the sleep(1) call does not fully eliminate the animation; often the first frame is still displayed, leading to highly annoying flickering that is quite hard to track down.\n\nRegression:\nTested in Xcode 7.1 on iOS 9.1 (iPhone 6s device, various iPhone simulators).\n\nNotes:\n- It is not always obvious that snapshotViewAfterScreenUpdates is called inside an animation block; sometimes a caller sets up the animation further up the call stack.\n- Always creating snapshots inside a UIView.performWithoutAnimation block works around the issue.\n\n-\nProduct Version: iOS 9.1 (13B143)\nCreated: 2015-10-27T18:58:42.523960\nOriginated: 2015-10-27T19:58:00\nOpen Radar Link: http://www.openradar.me/23280454"}}