I want to implement custom UIView (from code) with dynamic height, based on content (similar to UILabel). I can do this by implementing intrinsicContentSize
- and it seems to work correctly, but...
When I am adding my custom view to view controller on storyboard, I've got error (missing height constraint) - even when during launch everything seems to resize correctly.
When you add UILabel to storyboard you don't have to specify height, there are no errors. How to achieve the same behavior for custom UIView (I want to use it in storyboard)?
If someone will need the solution:
I just found that there is "Intrinsic Size" property in Storyboard - you just need to set it to "Placeholder" and set some values just for Interface Builder...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With