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.
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
}