Skip to content

Migrating from PureLayout v2.x to v3.0

Tyler Fox edited this page Aug 17, 2015 · 19 revisions

PureLayout v3.0.0

PureLayout v3.0.0 is a major release, with new APIs, enhancements, and other changes. See the release notes for an overview of changes.

Moved APIs

The most significant breaking change in PureLayout v3.0.0 is the move of the following class methods from their original home on UIView/NSView to their new home on NSLayoutConstraint:

  • +[autoCreateConstraintsWithoutInstalling:]
  • +[autoSetPriority:forConstraints:]
  • +[autoSetIdentifier:forConstraints:]

When migrating existing code using v2.x to v3.0.0, you just need to find & replace the class name at each call site. For example, this code using PureLayout v2.x:

[UIView autoSetPriority:UILayoutPriorityDefaultHigh forConstraints:^{ /* ... */ }];

Simply changes to the following with PureLayout v3.0.0:

[NSLayoutConstraint autoSetPriority:UILayoutPriorityDefaultHigh forConstraints:^{ /* ... */ }];

Removed APIs

The APIs that were deprecated in PureLayout v2.0.0 have been removed entirely. You weren't using those anymore, right? 😉 See this section of the v2.x Migration Guide for more details.

Clone this wiki locally