Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Simulator does not refresh correctly

I try to simulate a very very simple application which I have created in Xcode 9. I try to simulate it in the iOS Simulator in an iPhone6 with iOS 11.2. I have also tested other devices with the same result.

On a real device, the app works as expected. But on the simulator it doesn't.

I expect, that the button will become orange after I have clicked on it. and the emoji should disappear. Instead it changes into some strange "shadowed" look. If I wait then, the button will sometimes turn its background to orange after around 30 seconds.

I have recorded a gif, to illustrate the problem.

http://www.giphy.com/gifs/l4pSUuBtN7aBVvbVe

UPDATE:

Here is another GIF: http://www.giphy.com/gifs/26DNe5B0vxIO6pHiw The button gets refreshed, as soon as i drag down the info center.

Development machine: Mac mini 2011, i5, SSD, 8GB RAM, high Sierra

hope someone can help me.

UPDATE: 15.02.18 The problem only appears with iOS versions beginning from 10 and up. With iOS Version 9.0 there is no problem. Expect that there arent any emojis...

In the meantime, i have filed a bug report to apple. But i think there will be no response on that.

Looks that others having the same problem: https://forums.developer.apple.com/thread/96511

like image 927
C. Hediger Avatar asked Dec 23 '22 10:12

C. Hediger


1 Answers

iOS 13 UPDATE: Use the Hardware > Toggle In-call Status Bar option for all devices with iOS 13 or higher. The activity indicator is gone for all devices. Fortunately, the in-call status bar no longer changes the layout size.

--

I have finally found a working workaround for this!

For simulators without the notch, set this when you launch the app:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

Swift 4.1:

UIApplication.shared.isNetworkActivityIndicatorVisible = true

and never set it back to NO. This will show the little loading indicator in statusbar, which will keep the simulator constantly active and will solve your issue.

Just don't forget to make sure you will not use it in the production configuration.

Simulators with the notch in the status bar (iPhone X) don't show the activity indicator, but you can use Hardware > Toggle In-call Status Bar, because the in-call icon is animating and will also keep the screen active.

like image 131
David Riha Avatar answered Jan 05 '23 16:01

David Riha