IBDesignable never finishes updating UITableViewCell in storyboard

六月ゝ 毕业季﹏ 提交于 2019-12-03 06:52:07

This issue has been resolved as of Xcode 9.

I had reported this issue to Apple and at least have the piece of mind knowing that this is a known bug. It is currently an open issue under the problem ID 17973876.

Edit: As of 12/7/2016 this bug is still marked as open.

mxwt

I was having similar problems. This thread helped me understand the issue: Is there a way for Interface Builder to render IBDesignable views which don't override drawRect:

I got it to work by adding

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        layoutSubviews()
    }

as far as i understand after reading the above stack link, IBDesignable loads the nib in storyboard not from nib or from coder but from the init with frame. Not too sure but I think init with style is doing a similar thing.

It seems that the "Updating" bug is happening only when the cell is inside a storyboard. Everything works OK when you create special .xib file just for the cell.

Hopefully, they will fix it soon.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!