concept margin in category ios
appears as: margin, margins, margins

This is an excerpt from Manning's book iOS Development with Swift.
Add the following line where you set up the redView in the viewDidLoad method: Follow the same process for the label described in table 6.4.redView.autoresizingMask = [.flexibleHeight, .flexibleWidth, .flexibleBottomMargin]In the label’s case, the right margin, top margin, and bottom margin are all relative to the superview, so you should set them to springs.
Attribute
Description
Left margin 20 Width Fixed width Right margin Width of superview (minus) width (minus) left margin Top margin Half the height of the superview Height Fixed height Bottom margin Superview height (minus) height (minus) top margin
Give the outer stack view fixed margins by selecting Fixed in the Layout Margins section of the Size Inspector, with margins of 16 all round. The stack view should now be nicely framed in the scroll view (see figure 8.10). You can take advantage of the scroll view’s ability to dismiss the keyboard.