github SnapKit/SnapKit 3.0.0
SnapKit 3.0.0 - Swift 3.0 Release

latest releases: 5.7.1, 5.7.0, 5.6.0...
7 years ago

SnapKit 3.0 is a complete re-write to take advantage of modern Swift 3.0 as well as
clean up the API. As such please use with caution and check your apps thoroughly

Breaking

  • iOS 7.0 support has been removed
  • install and uninstall have been deprecated, use activate and deactivate instead
  • DSL is now accessed through .snp.* rather than .snp_*. For example view.snp.makeConstraints { }
  • Constraints are now updated through update(offset:), update(inset:) and update(priority:)
  • .inset() will no longer take CGPoint or CGSize as input
  • .offset() will no longer take CGPoint, CGSize, EdgeInsets as input
  • updateConstraints will no longer allow creating new constraints unless there are no existing constraints for the view. If it does generate new constraints it will throw a fatal error.
  • UIEdgeInsets are now have their right and bottom value inverted for more natural results such as make.edges.equalTo(UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)).inset()

Enhancements

  • Debugging output has been improved to show exact file/line number from which the broken constraint was created
  • Exceptions thrown during constraint creation have been replaced with fatalError with better output
  • Constraints are now installed through NSLayoutConstraint.activate and what view they are added to is now deferred to UIKit
  • Added var contentHugging<Axis>Priority: CGFloat to make
  • Added var contentCompressionResistance<Axis>Priority: CGFloat to make
  • Added support for UILayoutGuide via make.left.equalTo(guide.snp.top)
  • Added support for constraining edges to margins or vice versa via make.edges.equalTo(other.snp.margins)

Don't miss a new SnapKit release

NewReleases is sending notifications on new releases.