[xcode] 紫warningや”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”エラー対処方法
“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”というエラーがxcodeに表示されまくり、アプリは落ちないものの気持ち悪かったので、対処した。
またxcodeではすごい色の紫warningも出るので、同じく対処
warningの理由としてはメインスレッドで動作させなければならないメソッドを注意してくれるみたい。
indicator.isHidden = true
を
DispatchQueue.main.async { indicator.isHidden = true }
に変更しメインスレッドで処理させるとエラーが表示されなくなる。