Minimum size for custom views

I have a custom view @IBDesignable.

I want to have a minimum height.

If I add a view to the code I override

override init(frame: CGRect) { let height = frame.height > minHeight ? minHeight : frame.height let minFrame = CGRectMake(frame.origin.x, frame.origin.y, frame.width, height) super.init(frame: minFrame) } 

set the minimum height.

when adding to storyboard

 required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } 

.

So where can I set the minimum height?

thanks

+5
source share

Source: https://habr.com/ru/post/1245484/


All Articles