-[UIApplication delegate] must be called from main thread only

Viewed 55211

This warning leads to a serious problem cause I really can't call the delegate outside of the main thread using Xcode 9 beta 2. Strange thing is that this was working when I was using Xcode 8.3.3.

Also I thought it would only be good practice to call delegates from main thread only, isn't it? So why is this causing the app to crash now?

2 Answers

In Swift, you could also use DispatchQueue.main.async to call the UI controlling method from the main thread

DispatchQueue.main.async {
    YourUIControlMethod()
}
Related