8

I'm having an issue using a UIWebView.

I keep receiving the following when the UIWebView expands to full-screen mode:

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.

Here's my simple code, and the only code I have:

@IBOutlet var player: UIWebView!

override func viewDidLoad()
{
    super.viewDidLoad()

    let url = "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"

    let frame: Int = 10

    let html = "<html><body><iframe src=\"\(url)\" width=395 height=290 frameborder=\(frame)></iframe></body></html>"

    player.loadHTMLString(html as String, baseURL: nil)
}

I tried the solution from the following question, which did nothing:

  1. Getting a "This application is modifying the autolayout engine" error?
  2. This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes
  3. This application is modifying the autolayout engine from a background thread - ios9
  4. Modifying the autolayout engine from a background thread error, from C++
  5. This application is modifying the autolayout engine from a background thread swift2.0
  6. "This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes...."
  7. Xcode7: This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes
  8. dispatch_async(dispatch_get_main_queue(), {
        let html = "<html><body><iframe src=\"\(url)\" width=395 height=290 frameborder=\(frame)></iframe></body></html>"
        self.player.loadHTMLString(html as String, baseURL: nil)
    })
    

I tried another solution:

  1. iOS9 - This application is modifying the autolayout engine from a background thread -- where?

Adding PSPDFUIKitMainThreadGuard to the project did not resolve this issue.

As you can see, my code is VERY simple, unlike other questions I've found, and all those solutions point to executing UI changes in the main thread, which I added the code to try and do, but I still received the warning.

There were many more questions I found similar to mine, but they all point to the same solution, which does not work for me, so I didn't bother to list them.

Does anyone have any insight into this? You can try this simple code yourself and you'll see the same issue.

Thanks

Community
  • 1
  • 1
Pangu
  • 3,721
  • 11
  • 53
  • 120

0 Answers0