-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
I found a bug where if a view inherits from NibDesignable, layoutSubviews gets called with the original sizes from the nibs but not for subsequent resizes. I noticed it when I was making a circular image view and despite doing self.imageView.layer.cornerRadius = self.imageView.frame.size.width /2 in layoutSubviews, the image was rounded strangely, even when it had a 1:1 aspect ratio using autolayout.
My fix was simply to add self.layoutIfNeeded to awakeFromNib but I suspect the issue goes deeper than that.
Metadata
Metadata
Assignees
Labels
No labels