View
public extension ViewProvides convienience methods for using auto layout and constraining view to the parent.
- 
                  
                  Creates the most basic constraints dedicated for constraining to 4 anchors of the parent veiw: top -> top, bottom -> bottom. leading -> leading, trailing -> trailing. Will attemp to use safeAreaLayoutGuideif possible.DeclarationSwift @discardableResult @inline(__always) func pin(toSafeAreaOf view: View, anchor: Anchor = .all, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]ParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. anchorAnchor type to be used for determining which constraints to generate. Defaults to alland generates constaints to all 4 sides.marginNumber to be used as a constant for generated constraints. Same value applied to all generated constraints if there are multiple. Return ValueGenerated active constraints. 
- 
                  
                  Convenience function for creating constraints while utilizing Margin enum DeclarationSwift @discardableResult @inline(__always) func pin(to view: View, anchor: Anchor = .all, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]ParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. anchorAnchor type to be used for determining which constraints to generate. Defaults to alland generates constaints to all 4 sides.marginNumber to be used as a constant for generated constraints. Same value applied to all generated constraints if there are multiple. Will automatically handle conversion to CGFloat. Return ValueGenerated active constraints. 
- 
                  
                  Creates opposite constraints: source top anchor to bottom anchor of the target view. DeclarationSwift @discardableResult @inline(__always) func pinTopToBottom(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> LayoutConstraintParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. marginNumber of points to be used for generating margin for the view. Return ValueGenerated active constraints. 
- 
                  
                  Creates opposite constraints: source bottom anchor to top anchor of the target view. DeclarationSwift @discardableResult @inline(__always) func pinBottomToTop(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> LayoutConstraintParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. marginNumber of points to be used for generating margin for the view. Return ValueGenerated active constraints. 
- 
                  
                  Creates opposite constraints: source leading anchor to trailing anchor of the target view. DeclarationSwift @discardableResult @inline(__always) func pinLeadingToTrailing(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> LayoutConstraintParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. marginNumber of points to be used for generating margin for the view. Return ValueGenerated active constraints. 
- 
                  
                  Creates opposite constraints: source trailing anchor to leading anchor of the target view. DeclarationSwift @discardableResult @inline(__always) func pinTrailingToLeading(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> LayoutConstraintParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. marginNumber of points to be used for generating margin for the view. Return ValueGenerated active constraints. 
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToTopLeading(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToTopLeading(ofSafeArea view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToTopTrailing(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToTopTrailing(ofSafeArea view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToBottomLeading(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToBottomLeading(ofSafeArea view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToBottomTrailing(of view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Undocumented DeclarationSwift @discardableResult @inline(__always) func pinToBottomTrailing(ofSafeArea view: View, margin: CGFloat = 0, isActive: Bool = true) -> [Anchor : LayoutConstraint]
- 
                  
                  Creates constraints for width/height/size dimensions with specified size. DeclarationSwift @discardableResult @inline(__always) func set(_ dimension: Dimension, _ value: CGFloat) -> [LayoutConstraint]ParametersdimensionDimension type to be used for determining which constraints to generate. Use sizeto generate width and height constraints simultaneously.valueSize of set dimensions. Return ValueGenerated active constraints. 
- 
                  
                  Creates constraints for width/height/size dimensions based on another view’s width/height/size. DeclarationSwift @discardableResult func set(_ dimension: Dimension, to view: View) -> [LayoutConstraint]ParametersdimensionDimension type to be used for determining which dimension constraints to generate. Use sizeto generate width and height constraints simultaneously..viewParent of sibling view to use as a reference for constraints. Return ValueGenerated active constraints. 
- 
                  
                  Creates constraints based on center x and y axis. DeclarationSwift @discardableResult @inline(__always) func center(to view: View, axis: Axis? = nil) -> [LayoutConstraint]ParametersviewTarget view to which apply constrainta. Can be parent view or view which shares the same parent. Both source and target views have to be part of the view hierarchy. axisAxis type to be used for determining which constraints to generate. Use allto generate center constraints for x and y axis simultaneously.Return ValueGenerated active constraints. 
 View on GitHub
View on GitHub View Extension Reference
        View Extension Reference