Getting a “This application is modifying the autolayout engine from a background thread” error?

后端 未结 21 1863
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 15:52

Been encountering this error a lot in my OS X using swift:

\"This application is modifying the autolayout engine from a background thread, which can

21条回答
  •  不要未来只要你来
    2020-11-22 16:20

    I had the same problem. Turns out I was using UIAlerts that needed the main queue. But, they've been deprecated.
    When I changed the UIAlerts to the UIAlertController, I no longer had the problem and did not have to use any dispatch_async code. The lesson - pay attention to warnings. They help even when you don't expect it.

提交回复
热议问题