Is it ok to create a UIView on a background thread?

前端 未结 3 719
长发绾君心
长发绾君心 2020-12-03 07:42

I know UIView are not thread safe so i cant add a view on a background thread, to work around this is it ok to create a UIView on a background thread then add it on the main

3条回答
  •  心在旅途
    2020-12-03 08:25

    I use Xcode Version 9.0 beta 3 (9M174d), receiving a warning.

    [UView init] must be called from main thread only

    So I think you should create UI in main thread better

    Show the picture below :

提交回复
热议问题