LayoutGuide

open class LayoutGuide<Super> : LayoutElement, ElementInLayoutTime where Super : LayoutElement
extension LayoutGuide: CustomDebugStringConvertible

LayoutGuides will not show up in the view hierarchy, but may be used as layout element in an RectBasedConstraint and represent a rectangle in the layout engine. Create a LayoutGuide with -init Add to a view with UIView.add(layoutGuide:) If you use subclass LayoutGuide, that manages LayoutElement elements, than you should use layout(in: frame) method for apply layout, otherwise elements will be have wrong position.

  • Undocumented

    Declaration

    Swift

    public var superLayoutBounds: CGRect { get }
  • Entity that represents element in layout time

    Declaration

    Swift

    public var inLayoutTime: ElementInLayoutTime { get }
  • Internal space for layout subelements

    Declaration

    Swift

    public var layoutBounds: CGRect { get }
  • Layout element where added this layout guide. For addition use func add(layoutGuide:).

    Declaration

    Swift

    open internal(set) weak var ownerElement: Super? { get set }
  • External representation of layout entity in coordinate space

    Declaration

    Swift

    open var frame: CGRect { get set }
  • Internal coordinate space of layout entity

    Declaration

    Swift

    open var bounds: CGRect { get set }
  • Layout element that maintained this layout entity

    Declaration

    Swift

    open weak var superElement: LayoutElement?
  • Removes layout element from hierarchy

    Declaration

    Swift

    open func removeFromSuperElement()
  • Undocumented

    Declaration

    Swift

    public init(frame: CGRect = .zero)
  • Tells that a this layout guide was added to owner

    Declaration

    Swift

    open func didAddToOwner()
  • Performs layout for subelements, which this layout guide manages, in layout space rect

    Declaration

    Swift

    open func layout(in rect: CGRect)

    Parameters

    rect

    Space for layout

  • Undocumented

    Declaration

    Swift

    open func add(to owner: Super)
  • Defines rect for bounds property. Calls on change frame.

    Declaration

    Swift

    open func contentRect(forFrame frame: CGRect) -> CGRect

    Parameters

    frame

    New frame value.

    Return Value

    Content rect

  • Undocumented

    Declaration

    Swift

    open var debugContentOfDescription: String { get }

LayoutGuide and placeholders

  • Declaration

    Swift

    public var debugDescription: String { get }
  • Creates dependency between two layout guides.

    Declaration

    Swift

    func add(layoutGuide: LayoutGuide<Super>)

    Parameters

    layoutGuide

    Child layout guide.

Available where Super: NSView

Available where Super: CALayer

Available where Super: NSView

Available where Super: CALayer

  • Undocumented

    Declaration

    Swift

    public func convert(_ point: CGPoint, to coordinateSpace: CALayer) -> CGPoint
  • Undocumented

    Declaration

    Swift

    public func convert(_ point: CGPoint, from coordinateSpace: CALayer) -> CGPoint
  • Undocumented

    Declaration

    Swift

    public func convert(_ rect: CGRect, to coordinateSpace: CALayer) -> CGRect
  • Undocumented

    Declaration

    Swift

    public func convert(_ rect: CGRect, from coordinateSpace: CALayer) -> CGRect
  • Fabric method for generation layer with any type

    Declaration

    Swift

    func build<L>(_ type: L.Type) -> L where L : CALayer

    Parameters

    type

    Type of layer

    Return Value

    Generated layer

  • Generates layer and adds to superElement hierarchy

    Declaration

    Swift

    @discardableResult
    func add<L>(_ type: L.Type) -> L? where L : CALayer

    Parameters

    type

    Type of layer

    Return Value

    Added layer