app modifying the autolayout engine from a background thread
<p>I am almost done migrating an iOS app of mine to Swift 3.0.
But I still have a few cases similar to the one below.
Most of them I have been able to solve by putting the problematic code on the main thread.</p>

<p>In some other cases, I can't figure out, which part of my code is executing on the wrong thread. And I get a message like this one:</p>

<pre><code>This 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.
 Stack:(
    0   CoreFoundation                      0x000000018765a1d8 &lt;redacted&gt; + 148
    1   libobjc.A.dylib                     0x000000018609455c objc_exception_throw + 56
    2   CoreFoundation                      0x000000018765a108 &lt;redacted&gt; + 0
    3   Foundation                          0x0000000188241ea4 &lt;redacted&gt; + 192
    ....................
    16  libsystem_pthread.dylib             0x00000001866eece4 &lt;redacted&gt; + 200
    17  libsystem_pthread.dylib             0x00000001866ee378 pthread_mutex_lock + 0
    18  libsystem_pthread.dylib             0x00000001866edda4 start_wqthread + 4
)
</code></pre>

<p>Is there some special technic (option when using the debugger or ??) I can use to trace the path followed by the progran, to see where this is happening?</p>