IB Designables: Failed to render and update auto layout status

后端 未结 14 1144
花落未央
花落未央 2020-12-13 04:11

I have a custom view (xib) that has a UIButton inside of it, I made id IBDesignable doing the following:

UserView.swif

14条回答
  •  温柔的废话
    2020-12-13 04:56

    I'm cringing at how dumb this is that doing what I'm about to tell you makes a difference, but you can try removing the breaking code out of

    override func prepareForInterfaceBuilder() {
    

    and only use it in

    override func awakeFromNib() {
    

    . I'm cringing, even more, when I report that its possible that your changes could still reflect in storyboard as desired when doing this.

    You can identify the breaking code by commenting out all the lines and using a process of elimination to identify the breaking line.

提交回复
热议问题