SnapKit Versions Save

A Swift Autolayout DSL for iOS & OS X

3.0.2

7 years ago

Bug Fixes

  • Fix Carthage build compatibility
  • Adds topMargin back in to ConstraintMaker
  • Adds equalToSuperview(), lessThanOrEqualToSuperview(), greaterThanOrEqualToSuperview()
  • Doing equalTo(CGPoint) ensures superview + offset from top left.

0.22.0

7 years ago

A tagged release for Swift 2.3!

3.0.1

7 years ago

Breaking Changes

  • Debug labels must now use a function rather than a property. snp.label = "" is now snp.setLabel("")

Bug Fixes

  • Fixed small memory leaks on all constraints #310
  • Fixed macOS bug preventing make.edges.equalTo(other.snp.edges) #309
  • Fixed bug preventing debug labels from being set. You must now use setLabel() #313
  • Fixed incorrect constant values when using leading/trailing and UIEdgeInsets #316

3.0.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)