-3

I am getting "runtime: UI API called from background thread: -[UIApplication delegate] must be used from main thread only " runtime issue for Fabric initialisation line. Not sure how to solve it. Please help

Thanks

Fabric.with([Crashlytics.self,Zendesk.self])

Issue Image

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Priyanka
  • 207
  • 2
  • 10

1 Answers1

2

It's because you are trying to access the UI from background thread. Just call the UI change in main thread.

DispatchQueue.main.async {
   application.statusBarStyle = UIStatusBarStyle.lightContent
}

UI process are maintained under main thread.

fAiSaL
  • 754
  • 1
  • 10
  • 29