concept Width in category ios

appears as: Width
iOS Development with Swift

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:
    redView.autoresizingMask = [.flexibleHeight, .flexibleWidth,
       .flexibleBottomMargin]
    Follow the same process for the label described in table 6.4.
    Table 6.4. Label

    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
    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.
  • Select the plus symbol to the left of the font attribute now. Here, you can select the size class you’re interested in, from Width, Height, and Gamut (a display type). The current size class is suggested as a default.