Anchorman v3.0 Release Notes

Release Date: 2017-09-19 // over 6 years ago

    ๐Ÿฑ The underlying framework is completely rewritten. If you find any bugs, please report them. ๐Ÿ›

    ๐Ÿ‘ This version is written in and supports Swift 4. If you need to use Swift 3, use version 2.0 of Anchorman instead.


    ๐Ÿ†• New Features

    ๐Ÿ‘ Anchorman now supports UILayoutGuide along with UIView constraints.

    โž• Adding support for .left and .right EdgeAnchors.


    ๐Ÿฑ โš ๏ธ Breaking changes โš ๏ธ

    โœ‚ Removed func translateAutoresizingMasks(on: Bool)

    โœ‚ Removed static func activateAllConstraints(constraints: [[NSLayoutConstraint]])

    โœ‚ Removed static func deactivateAllConstraints(constraints: [[NSLayoutConstraint]])

    For functions that had a parameter activate: Bool, it has now been renamed isActive: Bool.

    ๐Ÿ“Œ API changes for pinning

    func pinToSuperview(_ edges: [EdgeAnchor], relation: NSLayoutRelation, activate: Bool) -> [NSLayoutConstraint]

    func pinToSuperview(_ edges: [EdgeAnchor], relation: NSLayoutRelation, isActive: Bool) -> [NSLayoutConstraint]


    ๐Ÿ“Œ func pin(toView view: UIView, edges: [EdgeAnchor], relation: NSLayoutRelation, activate: Bool) -> [NSLayoutConstraint]

    ๐Ÿ“Œ func pin(to view: UIView, edges: [EdgeAnchor], relation: NSLayoutRelation, isActive: Bool) -> [NSLayoutConstraint]


    ๐Ÿ“Œ func pin(edge: EdgeAnchor, toEdge: EdgeAnchor, ofView view: UIView, relation: NSLayoutRelation, constant: CGFloat, priority: UILayoutPriority, activate: Bool) -> NSLayoutConstraint

    ๐Ÿ“Œ func pin(edge: EdgeAnchor, toEdge: EdgeAnchor, of view: UIView, relation: NSLayoutRelation = .equal, constant: CGFloat, priority: UILayoutPriority, isActive: Bool) -> NSLayoutConstraint


    func set(size sizeAnchor: SizeAnchor, relation: NSLayoutRelation, activate: Bool) -> NSLayoutConstraint

    func set(size sizeAnchor: SizeAnchor, relation: NSLayoutRelation, isActive: Bool) -> NSLayoutConstraint


    func set(size sizeAnchors: [SizeAnchor] = [SizeAnchor.width, SizeAnchor.height], relation: NSLayoutRelation, activate: Bool) -> [NSLayoutConstraint]

    func set(size sizeAnchors: [SizeAnchor] = [SizeAnchor.width, SizeAnchor.height], relation: NSLayoutRelation, isActive: Bool) -> [NSLayoutConstraint]


    func set(relativeSize sizeAnchor: SizeAnchor, toSizeAnchor: SizeAnchor, ofView view: UIView, multiplier: CGFloat, constant: CGFloat, relation: NSLayoutRelation, activate: Bool) -> NSLayoutConstraint

    func set(relativeSize sizeAnchor: SizeAnchor, toSizeAnchor: SizeAnchor, ofAnchorable anchorable: Anchorable, multiplier: CGFloat, constant: CGFloat, relation: NSLayoutRelation, isActive: Bool)