Search code examples
swift3autolayout

When I run my application In simulator it shows some autolayout errors


his application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.


Solution

  • Try this:

    It needs to be placed inside a different thread that allows the UI to update as soon as execution of thread function complete

    DispatchQueue.main.async 
    {
       // Update UI
    }