Guideline

public struct Guideline : OptionSet

Shows guide for an instance of view, Guideline adds single line view with constraints equivalents to edges, dimentions, baselines.

Guideline is part of UI debug helper tools. Example usage can be as below, as it adds lines using autolayouts it is expected target view should be added to its superview.

let label = UILabel()
...
...
// Creates guidelines set to be displayed
let guidelines: UIView.Guideline = [.leading, .firstBaseline, .bottom]

// Shows guideline on label
label.showGuide(guideline: guidelines)
  • Declaration

    Swift

    public let rawValue: Int
  • Declaration

    Swift

    public init(rawValue: Int)
  • top

    Guide for top edge.

    Declaration

    Swift

    public static let top: UIView.Guideline
  • Guide for bottom edge.

    Declaration

    Swift

    public static let bottom: UIView.Guideline
  • Guide for leading edge.

    Declaration

    Swift

    public static let leading: UIView.Guideline
  • Guide for trailing edge.

    Declaration

    Swift

    public static let trailing: UIView.Guideline
  • Guide for firstBaseline.

    Declaration

    Swift

    public static let firstBaseline: UIView.Guideline
  • Guide for lastBaseline.

    Declaration

    Swift

    public static let lastBaseline: UIView.Guideline
  • Guide for height dimention.

    Declaration

    Swift

    public static let height: UIView.Guideline
  • Guide for width dimention.

    Declaration

    Swift

    public static let width: UIView.Guideline
  • Guide for top, bottom, leading edges.

    Declaration

    Swift

    public static let basic: UIView.Guideline
  • all

    Guide for all edges, dimentions, baselines.

    Declaration

    Swift

    public static let all: UIView.Guideline