In interface builder, holding Command + = will resize a button to fit its text. I was wondering if this was possible to do programmatically before the
Simply:
UIView
as wrapper with auto layout to views around. UILabel
inside that wrapper. Add constraints that will stick tyour label to edges of wrapper.UIButton
inside your wrapper, then simple add the same constraints as you did for UILabel
.