How to fix warning after migration to xcode 11

1.5k views Asked by At

I need help in resolving these warnings after I migrated to Xcode 11. The warnings are as follows:

Unsupported use of UIKit API off the main thread: UIAccessibilityIsGuidedAccessEnabled() Unsupported use of UIKit API off the main thread: UIAccessibilityIsAssistiveTouchRunning() Unsupported use of UIKit API off the main thread: UIAccessibilityIsGuidedAccessEnabled() Unsupported use of UIKit API off the main thread: UIAccessibilityIsAssistiveTouchRunning() Unsupported use of UIKit API off the main thread: UIAccessibilityIsGuidedAccessEnabled()

1

There are 1 answers

0
donnywals On

You're modifying UI off the main thread. Wrap the calls to the listed methods in your code in DispatchQueue.main blocks:

DispatchQueue.main.async {
  // code goes here
}

If you want to learn more about DispatchQueue.main I wrote a blog post about it recently: link