swift报错 ui没有在主线程执行

发布时间:2018-08-29 17:10:37

提示如下信息:

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.










解决如下 把ui相关的放在DispatchQueue.main.async代码块中执行

  DispatchQueue.main.async(execute: {

                    let  view=HomeViewController();

                    self.navigationController!.pushViewController(view, animated: true)

    })


Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为