~2s delay after pushViewController on devices with iOS 13

Hi,

I have application in Swift 4 in MVVMC. After iOS 13 release I have problem with ~2s delay after pushViewController method. It is ok on iOS 11, 12. I've checked build created on xcode 10.3 and 11.2.1 and in both of them there is a issue with that delay.

Answered by arbura in 397990022

After a while I've found that one method with setting label.text callef from viewModel was called from globalQueue from some reasen. That caused that delay. I don't know yet why on iOS 11 and 12 that worked perfectly. I had to call that method from mainQueue and it woked perfectly for me. I'll have to check changes in iOS 13 about GCD.

It's Swift, I'm using .xib.

Accepted Answer

After a while I've found that one method with setting label.text callef from viewModel was called from globalQueue from some reasen. That caused that delay. I don't know yet why on iOS 11 and 12 that worked perfectly. I had to call that method from mainQueue and it woked perfectly for me. I'll have to check changes in iOS 13 about GCD.

Isn't it what I suggested in my reply Nov 22 ? It seems that was the correct answer.

Why did you answer it was already called from the main thread ?


So lesson for the future: when you ascertain something on the forum, please make sure it is correct.

Wasn't this the first answer by Claude31 back in November????



Claude31Nov 25, 2019 3:50 PM(

in response to arbura)


Did you try to replace line ( by :


  1. DispatchQueue.main.async {
  2. rootViewController.pushViewController(viewController, animated: true)
  3. }
~2s delay after pushViewController on devices with iOS 13
 
 
Q