Simulator screen not refreshing

I've been facing the following issue in the simulator since Xcode 9 -


The simulator does not refresh the layout on its screen in the completion block of UIView.animate() function calls. Consider the following code

let myView = UIView(frame: CGRect(x: 80.0, y: 80.0, width: 100.0, height: 100.0))

myView.isHidden = true


func presentNewScreen() {

UIView.animate(withDuration: 0.5, animations: {

//animate properties of some views in the current hierarchy ... works fine

}, completion: {(hasFinished:Bool) in

myView.isHidden = false

//the screen does not seem to refresh itself at this point ... so myView does not show up on the simulator screen

})

}

As indicated in the above snippet - even though the completion block is executed, myView does not show up on the Simulator Screen. Some points to note:

1) I logged a message inside the completion block so I can confirm that the completion block is indeed being called correctly

2) If I perform some action on the screen - eg click any other visible button or control element, the screen refresh is triggered and myView becomes visible

3) In case myView is a UIButton, even though it may not be visible, if I click on the region where its supposed to be located, the corresponding button action function is executed correctly

4) This has been happening since XCode 9, on ALL simulators running iOS 11.x as well as iOS 10.x

5) This DOES NOT happen on an actual device. The code works perfectly on any physical device

I am using a Macbook Pro 13" (Early 2011) running High Sierra, and using XCode 9.2. I read on another thread that there are some simulator issues on older machines with Intel HD 3000 Graphics configuration - https://forums.developer.apple.com/thread/88446

However the workaround suggested in the above thread doesnt work for me.

This is proving to be a real problem since I need the simulators to see and test my UI layouts on different device configurations. Any help will be greatly appreciated.

Thanks,

Replies

Hi


It looks like that i have the same problem.


Take a look here: https://forums.developer.apple.com/thread/97042

I also do have a mac from 2011 (mac mini)


Update:

I have filed a bug report, where i also mention your post.

I keep you updated if i get any news.

Have you tried to simulate it in iOS9?

My application works in iOS9. But this is not a solution.

Hi,


My app only runs on iOS 10 and higher so I cant test on iOS 9. However I do not think its an iOS version issue. The simulator bug occurs even if I use iOS 10.x in the simulator instead of iOS 11.x. And the same code worked perfectly in XCode 8.x

2011 Macs that only have an HD3000 for graphics end up using the software OpenGL stack becasue Metal is not available on those devices, and the Intel OpenGL driver for HD3000 has issues with memory exhaustion that result in corruption of the display. As such, we blacklisted HD3000 OpenGL in the simulator, which causes us to fall back to the OpenGL software renderer. This issue is a bug in the OpenGL software renderer. I urge you to file duplicate radars of the issue tracking this problem. Please mention that your radars are dupes of 36216048.

Thanks for the response. I had originally filed a bug report (# 37675135) on the 19th of Feb. I have added a comment on that report mentioning that it is a duplicate of 36216048.


~Regards

Basically a show stopper for 3 macmini's we use for development.... Do you think this will be fixed or should we dump these macmini's on ebay?

Also, we have a MacMini late 2012 with

Intel HD Graphics 4000


And have the same emulator problem. Does this driver issue effect that model also?

I've had this problem too with a late 2011 13" MacBook Pro with Intel HD 3000 graphics. I had a look at your solution to the related issue described in https://forums.developer.apple.com/thread/88446 and thought I'd experiment with other values for FramebufferEmulationHint. A value of '2' seems to be working for me:


defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferEmulationHint 2

It's now June and it seems that issue 36216048 is not yet fixed. Are you going to update OpenGL driver or software renderer for HD3000?

I'm having this or a simulator problem also. When using an 2011 Macbook Air and iOS simulator (10.0), sometimes the iPhone screen "freezes" and fails to refresh what should currently be on screen. If I interact with the display somehow (drag around an uiscrollview etc) the issue goes away for awhile.