FWLayoutChain

public class FWLayoutChain

视图链式布局类。如果约束条件完全相同,会自动更新约束而不是重新添加。 另外,默认布局方式使用LTR,如果需要RTL布局,可通过fwAutoLayoutRTL统一启用

  • 布局视图

    Declaration

    Swift

    public private(set) weak var view: UIView? { get }
  • 构造方法

    Declaration

    Swift

    public required init(view: UIView?)

Install

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func remake() -> FWLayoutChain

Compression

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func compressionHorizontal(_ priority: UILayoutPriority) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func compressionVertical(_ priority: UILayoutPriority) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func huggingHorizontal(_ priority: UILayoutPriority) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func huggingVertical(_ priority: UILayoutPriority) -> FWLayoutChain

Collapse

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func collapsed(_ collapsed: Bool) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func autoCollapse(_ autoCollapse: Bool) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func hiddenCollapse(_ hiddenCollapse: Bool) -> FWLayoutChain

Axis

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func center() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerX() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerY() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerToView(_ view: Any) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerXToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerYToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerXToView(_ view: Any, withMultiplier multiplier: CGFloat) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerYToView(_ view: Any, withMultiplier multiplier: CGFloat) -> FWLayoutChain

Edge

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edges(_ insets: UIEdgeInsets = UIEdgeInsets.zero) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edges(_ insets: UIEdgeInsets = UIEdgeInsets.zero, excludingEdge edge: NSLayoutConstraint.Attribute) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edgesHorizontal() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edgesVertical() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func top(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func top(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottom(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottom(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func left(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func left(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func right(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func right(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func topToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func topToView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottomToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottomToView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func leftToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func leftToView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func rightToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func rightToView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func topToBottomOfView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func topToBottomOfView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottomToTopOfView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottomToTopOfView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func leftToRightOfView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func leftToRightOfView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func rightToLeftOfView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func rightToLeftOfView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain

SafeArea

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerToSafeArea(_ offset: CGPoint = CGPoint.zero) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerXToSafeArea(_ offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func centerYToSafeArea(_ offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edgesToSafeArea(_ insets: UIEdgeInsets = UIEdgeInsets.zero) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edgesToSafeArea(_ insets: UIEdgeInsets = UIEdgeInsets.zero, excludingEdge edge: NSLayoutConstraint.Attribute) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edgesToSafeAreaHorizontal() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func edgesToSafeAreaVertical() -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func topToSafeArea(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func topToSafeArea(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottomToSafeArea(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func bottomToSafeArea(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func leftToSafeArea(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func leftToSafeArea(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func rightToSafeArea(_ inset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func rightToSafeArea(_ inset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain

Dimension

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func size(_ size: CGSize) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func width(_ width: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func height(_ height: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func widthToHeight(_ multiplier: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func heightToWidth(_ multiplier: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func sizeToView(_ view: Any) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func widthToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func widthToView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func heightToView(_ view: Any, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func heightToView(_ view: Any, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func widthToView(_ view: Any, withMultiplier multiplier: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func heightToView(_ view: Any, withMultiplier multiplier: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain

Attribute

  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func attribute(_ attribute: NSLayoutConstraint.Attribute, toAttribute: NSLayoutConstraint.Attribute, ofView view: Any?, withOffset offset: CGFloat = 0) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func attribute(_ attribute: NSLayoutConstraint.Attribute, toAttribute: NSLayoutConstraint.Attribute, ofView view: Any?, withOffset offset: CGFloat = 0, relation: NSLayoutConstraint.Relation) -> FWLayoutChain
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func attribute(_ attribute: NSLayoutConstraint.Attribute, toAttribute: NSLayoutConstraint.Attribute, ofView view: Any?, withMultiplier multiplier: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> FWLayoutChain

Constraint

  • Undocumented

    Declaration

    Swift

    public var constraint: NSLayoutConstraint? { get }
  • Undocumented

    Declaration

    Swift

    public func constraint(_ attribute: NSLayoutConstraint.Attribute, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> NSLayoutConstraint?
  • Undocumented

    Declaration

    Swift

    public func constraintToSafeArea(_ attribute: NSLayoutConstraint.Attribute, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> NSLayoutConstraint?
  • Undocumented

    Declaration

    Swift

    public func constraint(_ attribute: NSLayoutConstraint.Attribute, toAttribute: NSLayoutConstraint.Attribute, ofView view: Any?, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> NSLayoutConstraint?
  • Undocumented

    Declaration

    Swift

    public func constraint(_ attribute: NSLayoutConstraint.Attribute, toAttribute: NSLayoutConstraint.Attribute, ofView view: Any?, withMultiplier multiplier: CGFloat, relation: NSLayoutConstraint.Relation = NSLayoutConstraint.Relation.equal) -> NSLayoutConstraint?