Analysis updated 2026-05-18
Build responsive iOS apps that adapt to different screen sizes and orientations without writing verbose constraint code.
Create Mac OS X desktop applications with clean, readable layout definitions using chainable syntax.
Set up complex view hierarchies with spacing, padding, and alignment rules in fewer lines of code.
Define constraint priorities so some layout rules can be broken when screen space is limited.
| snapkit/masonry | gnachman/iterm2 | realm/realm-swift | |
|---|---|---|---|
| Stars | 18,166 | 17,547 | 16,601 |
| Language | Objective-C | Objective-C | Objective-C |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 2/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Masonry is an Objective-C library for iOS and Mac OS X that simplifies the way developers define layout rules (called Auto Layout constraints) for user interface elements. Auto Layout is Apple's system for positioning views on screen in a way that adapts to different screen sizes and orientations. Normally, writing these constraints in code is very verbose, a single simple rule like "this view should fill its parent with 10 points of padding on each side" requires many lines of repetitive, hard-to-read code. Masonry provides a cleaner, chainable syntax for the same thing. Instead of constructing constraint objects manually, you use a block-based API where you describe relationships in a natural way, such as "make this view's edges equal to its superview's edges with insets." The library automatically attaches the constraints to the right views and handles the usual boilerplate of disabling autoresizing translation. It supports all standard layout attributes: position, size, centering, and spacing, as well as setting priorities so that some constraints can be broken when space is tight. The project recommends its Swift-language counterpart, SnapKit, for projects written in Swift, since Swift offers better type safety. Masonry itself remains actively maintained for Objective-C projects. It is available via CocoaPods and Carthage, the common iOS dependency managers.
Masonry simplifies iOS layout code by replacing verbose Auto Layout constraints with a clean, chainable syntax for positioning UI elements.
Mainly Objective-C. The stack also includes Objective-C, iOS SDK, Mac OS X SDK.
Use freely for any purpose including commercial, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.