UIEdgeInsets

public extension UIEdgeInsets
  • Returns the edge insets as directional edge insets.

    Important

    this maps .left to .leading, and .right to .trailing, which may not be correct in a RTL environment. This is merely a convenience method for converting from non-directional to directional insets.

    Declaration

    Swift

    var directionalInsets: NSDirectionalEdgeInsets { get }
  • Sum of top and bottom insets

    Declaration

    Swift

    public var vertical: CGFloat { get }
  • Sum of left and right insets

    Declaration

    Swift

    public var horizontal: CGFloat { get }
  • Creates edge insets with the same value on all four sides.

    Declaration

    Swift

    init(all value: CGFloat)

    Parameters

    value

    amount to inset (positive) all four edges. Values can be negative to ‘outset’

  • Creates edge insets with one value for vertical edges and another value for horizontal edges.

    Declaration

    Swift

    init(topAndBottom vertical: CGFloat, leftAndRight horizontal: CGFloat = 0)

    Parameters

    vertical

    amount to inset (positive) top and bottom. Values can be negative to ‘outset’

    horizontal

    amount to inset (positive) left and right. Values can be negative to ‘outset’ (defaults to 0)

  • Creates edge insets with the same value on horizontal edges (and 0 for vertical edges)

    Declaration

    Swift

    init(leftAndRight horizontal: CGFloat)

    Parameters

    horizontal

    amount to inset (positive) left and right. Values can be negative to ‘outset’