A lightweight iOS/macOS layout framework that wraps AutoLayout with a chainable, expressive DSL.
Masonry is a lightweight layout framework for iOS and macOS that wraps Apple's AutoLayout system with a simplified, chainable, and expressive syntax. It solves the problem of AutoLayout's verbose and hard-to-read code by providing a Domain-Specific Language (DSL) that makes creating and managing NSLayoutConstraints concise and readable.
iOS and macOS developers building user interfaces with AutoLayout who want to write more maintainable and readable layout code, especially those working in Objective-C.
Developers choose Masonry because it provides the full power of AutoLayout without the verbosity, using a clean, chainable API that reads like sentences. It offers great debug support and comprehensive constraint management while keeping the global namespace clean.
Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout
Replaces verbose NSLayoutConstraint code with a readable, sentence-like DSL—turning multiple lines into concise chains like `make.edges.equalTo(superview).with.insets(padding)`.
Supports all NSLayoutConstraint capabilities without limitations, allowing complex constraints like priorities, inequalities, and arrays of views.
Provides dedicated methods for creating (`mas_makeConstraints`), updating (`mas_updateConstraints`), and remaking (`mas_remakeConstraints`) layouts, simplifying dynamic UI changes.
Assigns meaningful names to constraints in AutoLayout error console output, making it easier to identify and resolve conflicts compared to raw AutoLayout.
Automatically sets `translatesAutoresizingMaskIntoConstraints = NO` and adds constraints to appropriate views, reducing manual setup errors.
The README explicitly recommends SnapKit for Swift projects, as Masonry's Objective-C API lacks native Swift type safety and can feel clunky with bridging headers.
Requires developers to learn a new chainable syntax and methods, which can be a barrier for teams comfortable with raw AutoLayout or other frameworks.
Adds external library reliance, which can complicate updates or migrations, especially as Apple evolves AutoLayout and introduces SwiftUI.
Does not integrate seamlessly with newer Apple technologies like SwiftUI, forcing developers to mix paradigms or use alternative solutions for modern app development.
A Swift Autolayout DSL for iOS & OS X
Yoga is an embeddable layout engine targeting web standards.
Template auto layout cell for automatically UITableViewCell height calculating
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.