Changelog
All notable changes to Masonry are documented here.
v1.3.6
Renamed internal helper functions to follow naming conventions
Renamed _MASBoxValue to masBoxValue and _MASExpectBoxValue to masExpectBoxValue to comply with C function naming conventions (leading underscores are reserved). The public MASBoxValue() macro interface remains unchanged.
Renamed static variable to follow global naming convention
Renamed kInstalledConstraintsKey to gInstalledConstraintsKey in MASViewConstraint.m to follow the global variable naming convention.
Fixed MASConstraint.h macro attribute ordering
Moved MAS_SWIFT_UI_ACTOR and NS_SWIFT_NAME(Constraint) before the documentation comment block on MASConstraint class declaration, ensuring correct attribute placement.
Added comprehensive documentation comments
Added Doxygen-style documentation comments to ObjC header files and implementation files across the core framework, examples, and test helpers, improving code readability and IDE documentation support.
Added SwiftLint disable directives
Added appropriate swiftlint:disable directives (file_name, force_unwrapping, implicitly_unwrapped_optional) to Swift source and test files to suppress lint warnings.
Fixed force-unwrap in Swift example
Changed topRow.first! to safe if let unwrapping in DistributeExampleView to prevent potential runtime crashes.
Code style improvements
- Fixed trailing comma consistency in
Package.swiftandExamples.swiftpm/Package.swift - Reformatted long single-line expressions into multi-line format for better readability
- Fixed double semicolon
;;typo inMASViewConstraint.m - Used numeric literal separators in Swift (
1000→1_000,0.0001→0.000_1) - Simplified CSS values (
#ffffff→#fff,0.95rem→.95rem) - Added copyright headers to source files missing them
v1.3.5
Breaking Change: Unified superview method call style
Changed equalToSuperview, greaterThanOrEqualToSuperview, and lessThanOrEqualToSuperview from property-style methods to block-returning methods, enabling function-call style .equalToSuperview() consistent with .equalTo().
Migration: Add parentheses — constraint.equalToSuperview → constraint.equalToSuperview().
Added WithLocation variants for superview methods
New methods equalToSuperviewWithLocation, greaterThanOrEqualToSuperviewWithLocation, and lessThanOrEqualToSuperviewWithLocation automatically embed call-site file name and line number into the constraint's mas_key for improved debugging.
Added mas_greaterThanOrEqualToSuperview() and mas_lessThanOrEqualToSuperview() macros
All three superview macros now call WithLocation variants for automatic debug info. Updated mas_equalToSuperview() from property alias to function-call style.
Swift DSL compatibility maintained
Superview methods marked NS_REFINED_FOR_SWIFT with explicit Swift wrapper methods in ConstraintProxy.swift. Swift API unchanged — make.top.equalToSuperview() works as before with automatic debug info.
v1.3.4
Restored mas_ prefix in Swift with deprecation guidance
Reverted the NS_SWIFT_NAME renaming introduced in v1.3.3 and replaced it with NS_REFINED_FOR_SWIFT. ObjC properties and methods (e.g. mas_left, mas_makeConstraints:) are now hidden from Swift's direct auto-import and re-exposed through the MASViewDSL proxy (view.mas.left, view.mas.makeConstraints { … }).
For backward compatibility, mas_-prefixed properties and methods are still available in Swift but marked as deprecated with @available(*, deprecated, renamed: "mas.xxx"), guiding users to migrate to the view.mas.xxx style.
Extended operator overloads for additional Swift types
Added ==, >=, <= operator overloads for Int, Double, CGSize, CGPoint, and UIEdgeInsets/NSEdgeInsets, in addition to the existing CGFloat and ViewAttribute overloads. Also added +, -, *, / arithmetic operator overloads for Int and Double.
Changed boxValue and constraint methods to reject optional types
The equalTo(_:), greaterThanOrEqualTo(_:), lessThanOrEqualTo(_:), and valueOffset(_:) methods on Constraint now accept Any instead of Any?. This change improves type safety and eliminates hidden runtime reflection overhead.
Improved test coverage
Added extensive unit tests for both ObjC and Swift modules, significantly improving code coverage.
v1.3.3
Refactored MasonrySwift: removed wrapper classes in favor of direct extensions
Eliminated the MASSwiftMakerProxy and MASSwiftConstraintProxy wrapper classes. All Swift DSL methods are now provided as direct extensions on ConstraintMaker and Constraint.
Renamed ObjC types for Swift via NS_SWIFT_NAME
Applied NS_SWIFT_NAME to core ObjC classes for cleaner Swift names (MASConstraint → Constraint, MASConstraintMaker → ConstraintMaker, etc.).
Type-safe operator overloads
Operator overloads now use concrete types instead of Any?, providing compile-time type safety and better autocompletion.
Added labeled(_:) and priority(_: MASConstraintPriority) convenience methods
Added external constraint update methods
New methods: updateOffset(_:), updateInsets(_:), updateInset(_:), updateCenterOffset(_:), updateSizeOffset(_:).
v1.3.2
Added Apple Privacy Manifest (PrivacyInfo.xcprivacy)
Added PrivacyInfo.xcprivacy to comply with Apple's privacy manifest requirements. The manifest declares that Masonry does not perform tracking, does not collect user data, and does not access any privacy-sensitive APIs.
Added Swift Code Snippets for Xcode
Three new Xcode code snippets for the Swift DSL: mas_swift_make, mas_swift_remake, mas_swift_update.
Changed key method signature from NSString * to id
The .key() method now accepts any object type as a constraint debug key.
Cleaned up legacy files
Removed obsolete files from the pre-SPM era.
v1.3.1
Added MASConstraintConvertible protocol
Introduced MASConstraintConvertible as a formal protocol for valid constraint targets, improving type safety.
Enhanced debug information
The mas_equalTo() macros now automatically embed call-site file name and line number into the constraint's mas_key.
v1.3.0
MasonrySwift API aligned with SnapKit
Refactored the MasonrySwift module so its API style matches SnapKit.
Added equalToSuperView convenience method
Performance improvement
Optimised the internal traversal logic for constraint installation.
Migrated to GitHub Actions
CI/CD pipeline migrated from Travis CI to GitHub Actions.
v1.2.x
- v1.2.3: Repository structure reorganisation
- v1.2.2: Reduced cyclomatic complexity
- v1.2.1: Added MASAttributeOffset operator, added SKILL.md
- v1.2.0: Swift Package Manager support, enhanced Swift support, modernisation
v1.0.x
- v1.0.2: Bug fixes for array constraints, view distribution performance
- v1.0.1: Added support for first/last baselines
- v1.0.0: Officially v1.0.0
v0.6.x
- v0.6.4: Added tvOS support
- v0.6.3: Added view distribution support
- v0.6.2: Added iOS 8 margin attributes, Carthage support
- v0.6.1: Fixed unused variable warning, added aspect fit example
- v0.6.0: Improved iOS 8 support
v0.5.x
- v0.5.3: Fixed Xcode 6 beta compilation errors
- v0.5.2: Fixed Shorthand view additions compilation warning
- v0.5.1: Fixed Objective-C++ compilation error
- v0.5.0: Fixed
mas_updateConstraintsbug, addedmas_remakeConstraints, autoboxing, attribute chaining
v0.4.0
Fixed Xcode auto-complete support. Breaking change: id<MASConstraint> → MASConstraint *.
v0.3.x
- v0.3.2: Mac OSX animator proxy, setter methods for constant proxies
- v0.3.1: Array constraint support
- v0.3.0: Added
mas_updateConstraints:, updated examples for iOS 7