【发布时间】:2015-11-03 23:37:18
【问题描述】:
相关:Is it ok to create a UIView on a background thread?
这个后台线程代码安全吗?
let viewController = MyViewController(nibName: nil, bundle: nil)
viewController.title = "My Title"
viewController.myProperty = true
dispatch_async(dispatch_get_main_queue(), {
self.navigationController?.pushViewController(viewController, animated: true)
})
【问题讨论】:
-
谢谢! :-) 那么,
MyViewController(nibName: nil, bundle: nil)不会触发任何 UI 更新?viewController.myProperty = true没有副作用。这只是一个简单的属性。
标签: ios uiviewcontroller thread-safety uikit background-thread