PrasathBabu
PrasathBabu

Reputation: 4846

In Xcode 14 & iOS 16 purple warnings starting with 'This method should not be called on the main thread as it may lead to UI unresponsiveness.'

When loading the URL in WKWebView, it leads to a security warning and later app gets crashes.

Warning in UIApplicationMain -

This method should not be called on the main thread as it may lead to UI unresponsiveness.

Security Warning in WKWebview

How can I resolve this issue?

Upvotes: 69

Views: 43780

Answers (2)

Grant Kamin
Grant Kamin

Reputation: 1329

Good in-depth reply from an Apple employee on the forums.

The poor interaction between WKWebView, Security framework, and this Xcode feature is a known issue (r. 94019453). We plan to address it at some point but I don’t have any info to share as to when that’ll happen.

Upvotes: 43

Filipe Canzi
Filipe Canzi

Reputation: 210

Apparently, it is either an Xcode bug or an unnecessary "perfect optimization" notification.

As I'm writing, there isn't any reported solution on the Apple developer website.

You can see a good discussion on UI unresponsiveness" warning on @main.

Upvotes: 19

Related Questions