Create a copy of a UIView in Swift

后端 未结 7 1846
长发绾君心
长发绾君心 2020-11-29 05:01

Because objects are reference types, not value types, if you set a UIView equal to another UIView, the views are the same object. If you modify one

7条回答
  •  遥遥无期
    2020-11-29 05:33

    I think that you should link you UIView with a .nib and just create a new one.

    Property will not be the same, but you keep appearance and methods.

提交回复
热议问题