Authored by Jonas Budelmann

rename MASConstraintBuilder to MASConstraintMaker

... ... @@ -16,14 +16,14 @@
DD52F1DA179CAA9C005CD195 /* MASCompositeConstraintSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1D8179CAA9C005CD195 /* MASCompositeConstraintSpec.m */; };
DD52F1DB179CAA9C005CD195 /* MASViewConstraintSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1D9179CAA9C005CD195 /* MASViewConstraintSpec.m */; };
DD52F1E7179CAACA005CD195 /* MASCompositeConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1DD179CAACA005CD195 /* MASCompositeConstraint.m */; };
DD52F1E8179CAACA005CD195 /* MASConstraintBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1E0179CAACA005CD195 /* MASConstraintBuilder.m */; };
DD52F1E8179CAACA005CD195 /* MASConstraintMaker.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1E0179CAACA005CD195 /* MASConstraintMaker.m */; };
DD52F1E9179CAACA005CD195 /* MASViewAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1E2179CAACA005CD195 /* MASViewAttribute.m */; };
DD52F1EA179CAACA005CD195 /* MASViewConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1E4179CAACA005CD195 /* MASViewConstraint.m */; };
DD52F1EB179CAACA005CD195 /* UIView+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DD52F1E6179CAACA005CD195 /* UIView+MASAdditions.m */; };
DD52F264179CB327005CD195 /* Masonry.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1ED179CAAEE005CD195 /* Masonry.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F265179CB32B005CD195 /* UIView+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1E5179CAACA005CD195 /* UIView+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F266179CB33F005CD195 /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1DE179CAACA005CD195 /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F267179CB342005CD195 /* MASConstraintBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1DF179CAACA005CD195 /* MASConstraintBuilder.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F267179CB342005CD195 /* MASConstraintMaker.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1DF179CAACA005CD195 /* MASConstraintMaker.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F268179CB346005CD195 /* MASViewAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1E1179CAACA005CD195 /* MASViewAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F269179CB34A005CD195 /* MASViewConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1E3179CAACA005CD195 /* MASViewConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD52F26A179CB365005CD195 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = DD52F1DC179CAACA005CD195 /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
... ... @@ -69,8 +69,8 @@
DD52F1DC179CAACA005CD195 /* MASCompositeConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASCompositeConstraint.h; sourceTree = "<group>"; };
DD52F1DD179CAACA005CD195 /* MASCompositeConstraint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASCompositeConstraint.m; sourceTree = "<group>"; };
DD52F1DE179CAACA005CD195 /* MASConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASConstraint.h; sourceTree = "<group>"; };
DD52F1DF179CAACA005CD195 /* MASConstraintBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASConstraintBuilder.h; sourceTree = "<group>"; };
DD52F1E0179CAACA005CD195 /* MASConstraintBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASConstraintBuilder.m; sourceTree = "<group>"; };
DD52F1DF179CAACA005CD195 /* MASConstraintMaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASConstraintMaker.h; sourceTree = "<group>"; };
DD52F1E0179CAACA005CD195 /* MASConstraintMaker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASConstraintMaker.m; sourceTree = "<group>"; };
DD52F1E1179CAACA005CD195 /* MASViewAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASViewAttribute.h; sourceTree = "<group>"; };
DD52F1E2179CAACA005CD195 /* MASViewAttribute.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASViewAttribute.m; sourceTree = "<group>"; };
DD52F1E3179CAACA005CD195 /* MASViewConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASViewConstraint.h; sourceTree = "<group>"; };
... ... @@ -200,8 +200,8 @@
DD52F1DE179CAACA005CD195 /* MASConstraint.h */,
DD52F1DC179CAACA005CD195 /* MASCompositeConstraint.h */,
DD52F1DD179CAACA005CD195 /* MASCompositeConstraint.m */,
DD52F1DF179CAACA005CD195 /* MASConstraintBuilder.h */,
DD52F1E0179CAACA005CD195 /* MASConstraintBuilder.m */,
DD52F1DF179CAACA005CD195 /* MASConstraintMaker.h */,
DD52F1E0179CAACA005CD195 /* MASConstraintMaker.m */,
DD52F1E1179CAACA005CD195 /* MASViewAttribute.h */,
DD52F1E2179CAACA005CD195 /* MASViewAttribute.m */,
DD52F1E3179CAACA005CD195 /* MASViewConstraint.h */,
... ... @@ -221,7 +221,7 @@
DD52F265179CB32B005CD195 /* UIView+MASAdditions.h in Headers */,
DDE2653F179D24E600D48565 /* UIView+MASShorthandAdditions.h in Headers */,
DD52F266179CB33F005CD195 /* MASConstraint.h in Headers */,
DD52F267179CB342005CD195 /* MASConstraintBuilder.h in Headers */,
DD52F267179CB342005CD195 /* MASConstraintMaker.h in Headers */,
DD52F268179CB346005CD195 /* MASViewAttribute.h in Headers */,
DD52F269179CB34A005CD195 /* MASViewConstraint.h in Headers */,
DD52F26A179CB365005CD195 /* MASCompositeConstraint.h in Headers */,
... ... @@ -358,7 +358,7 @@
buildActionMask = 2147483647;
files = (
DD52F1E7179CAACA005CD195 /* MASCompositeConstraint.m in Sources */,
DD52F1E8179CAACA005CD195 /* MASConstraintBuilder.m in Sources */,
DD52F1E8179CAACA005CD195 /* MASConstraintMaker.m in Sources */,
DD52F1E9179CAACA005CD195 /* MASViewAttribute.m in Sources */,
DD52F1EA179CAACA005CD195 /* MASViewConstraint.m in Sources */,
DD52F1EB179CAACA005CD195 /* UIView+MASAdditions.m in Sources */,
... ...
... ... @@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import "MASConstraint.h"
@interface MASConstraintBuilder : NSObject
@interface MASConstraintMaker : NSObject
@property (nonatomic, strong, readonly) id<MASConstraint> left;
@property (nonatomic, strong, readonly) id<MASConstraint> top;
... ...
... ... @@ -6,19 +6,19 @@
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASConstraintBuilder.h"
#import "MASConstraintMaker.h"
#import "MASViewConstraint.h"
#import "MASCompositeConstraint.h"
#import "MASViewAttribute.h"
@interface MASConstraintBuilder () <MASConstraintDelegate>
@interface MASConstraintMaker () <MASConstraintDelegate>
@property (nonatomic, strong) UIView *view;
@property (nonatomic, strong) NSMutableArray *constraints;
@end
@implementation MASConstraintBuilder
@implementation MASConstraintMaker
- (id)initWithView:(UIView *)view {
self = [super init];
... ...
... ... @@ -12,4 +12,4 @@
#import "MASCompositeConstraint.h"
#import "MASViewAttribute.h"
#import "MASViewConstraint.h"
#import "MASConstraintBuilder.h"
\ No newline at end of file
#import "MASConstraintMaker.h"
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "MASConstraintBuilder.h"
#import "MASConstraintMaker.h"
#import "MASViewAttribute.h"
@interface UIView (MASAdditions)
... ... @@ -24,6 +24,6 @@
@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY;
@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
- (void)mas_buildConstraints:(void(^)(MASConstraintBuilder *make))block;
- (void)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block;
@end
\ No newline at end of file
... ...
... ... @@ -10,11 +10,11 @@
@implementation UIView (MASAdditions)
- (void)mas_buildConstraints:(void(^)(MASConstraintBuilder *))block {
- (void)mas_makeConstraints:(void(^)(MASConstraintMaker *))block {
self.translatesAutoresizingMaskIntoConstraints = NO;
MASConstraintBuilder *constraintBuilder = [[MASConstraintBuilder alloc] initWithView:self];
block(constraintBuilder);
[constraintBuilder commit];
MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
block(constraintMaker);
[constraintMaker commit];
}
#pragma mark - attribute properties
... ...
... ... @@ -25,7 +25,7 @@
@property (nonatomic, strong, readonly) MASViewAttribute *centerY;
@property (nonatomic, strong, readonly) MASViewAttribute *baseline;
- (void)buildConstraints:(void(^)(MASConstraintBuilder *make))block;
- (void)makeConstraints:(void(^)(MASConstraintMaker *make))block;
@end
... ... @@ -48,8 +48,8 @@ MAS_ATTR_FORWARD(centerX);
MAS_ATTR_FORWARD(centerY);
MAS_ATTR_FORWARD(baseline);
- (void)buildConstraints:(void(^)(MASConstraintBuilder *))block {
[self mas_buildConstraints:block];
- (void)makeConstraints:(void(^)(MASConstraintMaker *))block {
[self mas_makeConstraints:block];
}
@end
... ...
... ... @@ -45,7 +45,7 @@
self.animatableConstraints = NSMutableArray.new;
[view1 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
[self.animatableConstraints addObjectsFromArray:@[
make.edges.equalTo(superview).insets(paddingInsets).priorityLow(),
make.bottom.equalTo(view3.mas_top).offset(-padding),
... ... @@ -56,7 +56,7 @@
make.height.equalTo(view3.mas_height);
}];
[view2 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view2 mas_makeConstraints:^(MASConstraintMaker *make) {
[self.animatableConstraints addObjectsFromArray:@[
make.edges.equalTo(superview).insets(paddingInsets).priorityLow(),
make.left.equalTo(view1.mas_right).offset(padding),
... ... @@ -67,7 +67,7 @@
make.height.equalTo(view3.mas_height);
}];
[view3 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view3 mas_makeConstraints:^(MASConstraintMaker *make) {
[self.animatableConstraints addObjectsFromArray:@[
make.edges.equalTo(superview).insets(paddingInsets).priorityLow(),
make.top.equalTo(view1.mas_bottom).offset(padding),
... ...
... ... @@ -35,7 +35,7 @@
UIView *superview = self;
int padding = 10;
[view1 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.greaterThanOrEqualTo(superview.mas_top).offset(padding);
make.left.equalTo(superview.mas_left).offset(padding);
make.bottom.equalTo(view3.mas_top).offset(-padding);
... ... @@ -48,7 +48,7 @@
.equalTo(view3.mas_height);
}];
[view2 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(superview.mas_top).offset(padding);
make.left.equalTo(view1.mas_right).offset(padding);
make.bottom.equalTo(view3.mas_top).offset(-padding);
... ... @@ -60,7 +60,7 @@
make.height.equalTo(view3.mas_height);
}];
[view3 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(view1.mas_bottom).offset(padding);
make.left.equalTo(superview.mas_left).offset(padding);
make.bottom.equalTo(superview.mas_bottom).offset(-padding);
... ...
... ... @@ -28,14 +28,14 @@
//example of using constants
[view1 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(@20);
make.left.equalTo(@20);
make.bottom.equalTo(@-20);
make.right.equalTo(@-20);
}];
[view2 mas_buildConstraints:^(MASConstraintBuilder *make) {
[view2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(@50);
make.centerX.equalTo(@0);
make.width.equalTo(@200);
... ...
... ... @@ -22,7 +22,7 @@
view.layer.borderWidth = 2;
[self addSubview:view];
[view mas_buildConstraints:^(MASConstraintBuilder *make) {
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(lastView).insets(UIEdgeInsetsMake(5, 10, 15, 20));
}];
... ...