Anchorable

public protocol Anchorable

Anything that exposes layout anchors. In our use this will be UIView and UILayoutGuide. This abstracts away the differences between them such that we can pass either a view or a layout guide to our constrain methods that act upon anchors.

  • Leading anchor

    Declaration

    Swift

    var leadingAnchor: NSLayoutXAxisAnchor { get }
  • Trailing anchor

    Declaration

    Swift

    var trailingAnchor: NSLayoutXAxisAnchor { get }
  • Left anchor (most often you should use leadingAnchor instead)

    Declaration

    Swift

    var leftAnchor: NSLayoutXAxisAnchor { get }
  • Right anchor (most often you should use trailingAnchor instead)

    Declaration

    Swift

    var rightAnchor: NSLayoutXAxisAnchor { get }
  • Top anchor

    Declaration

    Swift

    var topAnchor: NSLayoutYAxisAnchor { get }
  • Bottom anchor

    Declaration

    Swift

    var bottomAnchor: NSLayoutYAxisAnchor { get }
  • Width anchor

    Declaration

    Swift

    var widthAnchor: NSLayoutDimension { get }
  • Height anchor

    Declaration

    Swift

    var heightAnchor: NSLayoutDimension { get }
  • Center x anchor

    Declaration

    Swift

    var centerXAnchor: NSLayoutXAxisAnchor { get }
  • Center y anchor

    Declaration

    Swift

    var centerYAnchor: NSLayoutYAxisAnchor { get }