Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ios
/
Masonry
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Jonas Budelmann
12 years ago
Commit
25376fe71947bbb238352df8fb688a8feea6440d
1 parent
f0b65b9d
equal -> equalTo etc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
91 additions
and
96 deletions
Masonry/MASCompositeConstraint.m
Masonry/MASConstraint.h
Masonry/MASViewConstraint.m
Masonry/UIView+MASAdditions.h
Masonry/UIView+MASShorthandAdditions.h
MasonryExamples/MasonryExamples/MASExampleAnimatedView.m
MasonryExamples/MasonryExamples/MASExampleBasicView.m
MasonryExamples/MasonryExamples/MASExampleConstantsView.m
MasonryExamples/MasonryExamples/MASExampleSidesView.m
MasonryTests/MASViewConstraintSpec.m
MasonryTests/MasonryTests-Prefix.pch
Masonry/MASCompositeConstraint.m
View file @
25376fe
...
...
@@ -169,21 +169,21 @@
};
}
-
(
id
<
MASConstraint
>
(
^
)(
id
))
equal
{
-
(
id
<
MASConstraint
>
(
^
)(
id
))
equal
To
{
return
[
self
equalityWithBlock
:
^
id
(
id
<
MASConstraint
>
constraint
,
id
attr
)
{
return
constraint
.
equal
(
attr
)
;
return
constraint
.
equal
To
(
attr
)
;
}];
}
-
(
id
<
MASConstraint
>
(
^
)(
id
))
greaterThanOrEqual
{
-
(
id
<
MASConstraint
>
(
^
)(
id
))
greaterThanOrEqual
To
{
return
[
self
equalityWithBlock
:
^
id
<
MASConstraint
>
(
id
<
MASConstraint
>
constraint
,
id
attr
)
{
return
constraint
.
greaterThanOrEqual
(
attr
)
;
return
constraint
.
greaterThanOrEqual
To
(
attr
)
;
}];
}
-
(
id
<
MASConstraint
>
(
^
)(
id
))
lessThanOrEqual
{
-
(
id
<
MASConstraint
>
(
^
)(
id
))
lessThanOrEqual
To
{
return
[
self
equalityWithBlock
:
^
id
<
MASConstraint
>
(
id
<
MASConstraint
>
constraint
,
id
attr
)
{
return
constraint
.
lessThanOrEqual
(
attr
)
;
return
constraint
.
lessThanOrEqual
To
(
attr
)
;
}];
}
...
...
Masonry/MASConstraint.h
View file @
25376fe
...
...
@@ -28,9 +28,9 @@ typedef float MASLayoutPriority;
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
priorityLow
)();
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
priorityMedium
)();
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
priorityHigh
)();
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
equal
)(
id
attr
);
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
greaterThanOrEqual
)(
id
attr
);
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
lessThanOrEqual
)(
id
attr
);
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
equalTo
)(
id
attr
);
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
greaterThanOrEqualTo
)(
id
attr
);
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
lessThanOrEqualTo
)(
id
attr
);
-
(
void
)
commit
;
...
...
Masonry/MASViewConstraint.m
View file @
25376fe
...
...
@@ -189,7 +189,7 @@
[
self
.
delegate
addConstraint
:
self
];
}
-
(
id
<
MASConstraint
>
(
^
)(
id
))
equal
{
-
(
id
<
MASConstraint
>
(
^
)(
id
))
equal
To
{
return
^
id
(
id
attr
)
{
NSAssert
(
!
self
.
hasBeenCommitted
,
@"Cannot modify constraint equal relation after it has been committed"
);
...
...
@@ -201,7 +201,7 @@
};
}
-
(
id
<
MASConstraint
>
(
^
)(
id
))
greaterThanOrEqual
{
-
(
id
<
MASConstraint
>
(
^
)(
id
))
greaterThanOrEqual
To
{
return
^
id
(
id
attr
)
{
NSAssert
(
!
self
.
hasBeenCommitted
,
@"Cannot modify constraint greaterThanOrEqual relation after it has been committed"
);
...
...
@@ -213,7 +213,7 @@
};
}
-
(
id
<
MASConstraint
>
(
^
)(
id
))
lessThanOrEqual
{
-
(
id
<
MASConstraint
>
(
^
)(
id
))
lessThanOrEqual
To
{
return
^
id
(
id
attr
)
{
NSAssert
(
!
self
.
hasBeenCommitted
,
@"Cannot modify constraint lessThanOrEqual relation after it has been committed"
);
...
...
Masonry/UIView+MASAdditions.h
View file @
25376fe
...
...
@@ -24,6 +24,6 @@
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_centerY
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_baseline
;
-
(
void
)
mas_buildConstraints
:(
void
(
^
)(
MASConstraintBuilder
*
constrain
))
block
;
-
(
void
)
mas_buildConstraints
:(
void
(
^
)(
MASConstraintBuilder
*
make
))
block
;
@end
\ No newline at end of file
...
...
Masonry/UIView+MASShorthandAdditions.h
View file @
25376fe
...
...
@@ -25,7 +25,7 @@
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
centerY
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
baseline
;
-
(
void
)
buildConstraints
:(
void
(
^
)(
MASConstraintBuilder
*
constraints
))
block
;
-
(
void
)
buildConstraints
:(
void
(
^
)(
MASConstraintBuilder
*
make
))
block
;
@end
...
...
MasonryExamples/MasonryExamples/MASExampleAnimatedView.m
View file @
25376fe
...
...
@@ -45,38 +45,38 @@
self
.
animatableConstraints
=
NSMutableArray
.
new
;
[
view1
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
[
view1
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
make
)
{
[
self
.
animatableConstraints
addObjectsFromArray
:@[
constrain
.
edges
.
equal
(
superview
).
insets
(
paddingInsets
).
priorityLow
(),
constrain
.
bottom
.
equal
(
view3
.
mas_top
).
offset
(
-
padding
),
constrain
.
right
.
equal
(
view2
.
mas_left
).
offset
(
-
padding
),
make
.
edges
.
equalTo
(
superview
).
insets
(
paddingInsets
).
priorityLow
(),
make
.
bottom
.
equalTo
(
view3
.
mas_top
).
offset
(
-
padding
),
make
.
right
.
equalTo
(
view2
.
mas_left
).
offset
(
-
padding
),
]]
;
constrain
.
size
.
equal
(
view2
)
;
constrain
.
height
.
equal
(
view3
.
mas_height
)
;
make
.
size
.
equalTo
(
view2
)
;
make
.
height
.
equalTo
(
view3
.
mas_height
)
;
}];
[
view2
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
[
view2
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
make
)
{
[
self
.
animatableConstraints
addObjectsFromArray
:@[
constrain
.
edges
.
equal
(
superview
).
insets
(
paddingInsets
).
priorityLow
(),
constrain
.
left
.
equal
(
view1
.
mas_right
).
offset
(
padding
),
constrain
.
bottom
.
equal
(
view3
.
mas_top
).
offset
(
-
padding
),
make
.
edges
.
equalTo
(
superview
).
insets
(
paddingInsets
).
priorityLow
(),
make
.
left
.
equalTo
(
view1
.
mas_right
).
offset
(
padding
),
make
.
bottom
.
equalTo
(
view3
.
mas_top
).
offset
(
-
padding
),
]]
;
constrain
.
size
.
equal
(
view1
)
;
constrain
.
height
.
equal
(
view3
.
mas_height
)
;
make
.
size
.
equalTo
(
view1
)
;
make
.
height
.
equalTo
(
view3
.
mas_height
)
;
}];
[
view3
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
[
view3
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
make
)
{
[
self
.
animatableConstraints
addObjectsFromArray
:@[
constrain
.
edges
.
equal
(
superview
).
insets
(
paddingInsets
).
priorityLow
(),
constrain
.
top
.
equal
(
view1
.
mas_bottom
).
offset
(
padding
),
make
.
edges
.
equalTo
(
superview
).
insets
(
paddingInsets
).
priorityLow
(),
make
.
top
.
equalTo
(
view1
.
mas_bottom
).
offset
(
padding
),
]]
;
//TODO or pass an array
//constraints.height.equal(superview.subviews);
constrain
.
height
.
equal
(
view1
.
mas_height
)
;
constrain
.
height
.
equal
(
view2
.
mas_height
)
;
make
.
height
.
equalTo
(
view1
.
mas_height
)
;
make
.
height
.
equalTo
(
view2
.
mas_height
)
;
}];
UITapGestureRecognizer
*
tapGestureRecognizer
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
didTapWithGestureRecognizer
:)];
...
...
MasonryExamples/MasonryExamples/MASExampleBasicView.m
View file @
25376fe
...
...
@@ -35,41 +35,41 @@
UIView
*
superview
=
self
;
int
padding
=
10
;
[
view1
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
constrain
.
top
.
greaterThanOrEqual
(
superview
.
mas_top
).
offset
(
padding
)
;
constrain
.
left
.
equal
(
superview
.
mas_left
).
offset
(
padding
)
;
constrain
.
bottom
.
equal
(
view3
.
mas_top
).
offset
(
-
padding
)
;
constrain
.
right
.
equal
(
view2
.
mas_left
).
offset
(
-
padding
)
;
constrain
.
width
.
equal
(
view2
.
mas_width
)
;
[
view1
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
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
)
;
make
.
right
.
equalTo
(
view2
.
mas_left
).
offset
(
-
padding
)
;
make
.
width
.
equalTo
(
view2
.
mas_width
)
;
//you can chain same attribute
constrain
.
height
.
equal
(
view2
.
mas_height
)
.
equal
(
view3
.
mas_height
)
;
make
.
height
.
equalTo
(
view2
.
mas_height
)
.
equalTo
(
view3
.
mas_height
)
;
}];
[
view2
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
constrain
.
top
.
equal
(
superview
.
mas_top
).
offset
(
padding
)
;
constrain
.
left
.
equal
(
view1
.
mas_right
).
offset
(
padding
)
;
constrain
.
bottom
.
equal
(
view3
.
mas_top
).
offset
(
-
padding
)
;
constrain
.
right
.
equal
(
superview
.
mas_right
).
offset
(
-
padding
)
;
constrain
.
width
.
equal
(
view1
.
mas_width
)
;
[
view2
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
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
)
;
make
.
right
.
equalTo
(
superview
.
mas_right
).
offset
(
-
padding
)
;
make
.
width
.
equalTo
(
view1
.
mas_width
)
;
//or define it multiple times
constrain
.
height
.
equal
(
view1
.
mas_height
)
;
constrain
.
height
.
equal
(
view3
.
mas_height
)
;
make
.
height
.
equalTo
(
view1
.
mas_height
)
;
make
.
height
.
equalTo
(
view3
.
mas_height
)
;
}];
[
view3
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
constrain
.
top
.
equal
(
view1
.
mas_bottom
).
offset
(
padding
)
;
constrain
.
left
.
equal
(
superview
.
mas_left
).
offset
(
padding
)
;
constrain
.
bottom
.
equal
(
superview
.
mas_bottom
).
offset
(
-
padding
)
;
constrain
.
right
.
equal
(
superview
.
mas_right
).
offset
(
-
padding
)
;
[
view3
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
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
)
;
make
.
right
.
equalTo
(
superview
.
mas_right
).
offset
(
-
padding
)
;
//TODO or pass an array
//constraints.height.equal(superview.subviews);
constrain
.
height
.
equal
(
view1
.
mas_height
)
;
constrain
.
height
.
equal
(
view2
.
mas_height
)
;
make
.
height
.
equalTo
(
view1
.
mas_height
)
;
make
.
height
.
equalTo
(
view2
.
mas_height
)
;
}];
return
self
;
...
...
MasonryExamples/MasonryExamples/MASExampleConstantsView.m
View file @
25376fe
...
...
@@ -28,18 +28,18 @@
//example of using constants
[
view1
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
constrain
.
top
.
equal
(
@20
)
;
constrain
.
left
.
equal
(
@20
)
;
constrain
.
bottom
.
equal
(
@
-
20
)
;
constrain
.
right
.
equal
(
@
-
20
)
;
[
view1
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
make
)
{
make
.
top
.
equalTo
(
@20
)
;
make
.
left
.
equalTo
(
@20
)
;
make
.
bottom
.
equalTo
(
@
-
20
)
;
make
.
right
.
equalTo
(
@
-
20
)
;
}];
[
view2
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
constrain
.
centerY
.
equal
(
@50
)
;
constrain
.
centerX
.
equal
(
@0
)
;
constrain
.
width
.
equal
(
@200
)
;
constrain
.
height
.
equal
(
@100
)
;
[
view2
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
make
)
{
make
.
centerY
.
equalTo
(
@50
)
;
make
.
centerX
.
equalTo
(
@0
)
;
make
.
width
.
equalTo
(
@200
)
;
make
.
height
.
equalTo
(
@100
)
;
}];
return
self
;
...
...
MasonryExamples/MasonryExamples/MASExampleSidesView.m
View file @
25376fe
...
...
@@ -22,8 +22,8 @@
view
.
layer
.
borderWidth
=
2
;
[
self
addSubview
:
view
];
[
view
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
constrain
)
{
constrain
.
edges
.
equal
(
lastView
).
insets
(
UIEdgeInsetsMake
(
5
,
10
,
15
,
20
))
;
[
view
mas_buildConstraints
:
^
(
MASConstraintBuilder
*
make
)
{
make
.
edges
.
equalTo
(
lastView
).
insets
(
UIEdgeInsetsMake
(
5
,
10
,
15
,
20
))
;
}];
lastView
=
view
;
...
...
MasonryTests/MASViewConstraintSpec.m
View file @
25376fe
...
...
@@ -45,17 +45,17 @@ beforeEach(^{
describe
(
@"equality chaining"
,
^
{
it
(
@"should return same constraint when encountering equal for first time"
,
^
{
MASViewConstraint
*
newConstraint
=
constraint
.
equal
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
equal
To
(
secondViewAttribute
);
[
verify
(
delegate
)
addConstraint
:(
id
)
constraint
];
expect
(
newConstraint
).
to
.
beIdenticalTo
(
constraint
);
expect
(
constraint
.
secondViewAttribute
).
to
.
beIdenticalTo
(
secondViewAttribute
);
expect
(
constraint
.
layoutRelation
).
to
.
e
x_e
qual
(
NSLayoutRelationEqual
);
expect
(
constraint
.
layoutRelation
).
to
.
equal
(
NSLayoutRelationEqual
);
});
it
(
@"should start new constraint when encountering equal subsequently"
,
^
{
constraint
.
greaterThanOrEqual
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
equal
(
secondViewAttribute
);
constraint
.
greaterThanOrEqualTo
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
equalTo
(
secondViewAttribute
);
[
verify
(
delegate
)
addConstraint
:(
id
)
constraint
];
[
verify
(
delegate
)
addConstraint
:(
id
)
newConstraint
];
...
...
@@ -63,17 +63,17 @@ describe(@"equality chaining", ^{
});
it
(
@"should return same constraint when encountering greaterThanOrEqual for first time"
,
^
{
MASViewConstraint
*
newConstraint
=
constraint
.
greaterThanOrEqual
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
greaterThanOrEqual
To
(
secondViewAttribute
);
[
verify
(
delegate
)
addConstraint
:(
id
)
constraint
];
expect
(
newConstraint
).
to
.
beIdenticalTo
(
constraint
);
expect
(
constraint
.
secondViewAttribute
).
to
.
beIdenticalTo
(
secondViewAttribute
);
expect
(
constraint
.
layoutRelation
).
to
.
e
x_e
qual
(
NSLayoutRelationGreaterThanOrEqual
);
expect
(
constraint
.
layoutRelation
).
to
.
equal
(
NSLayoutRelationGreaterThanOrEqual
);
});
it
(
@"should start new constraint when encountering greaterThanOrEqual subsequently"
,
^
{
constraint
.
lessThanOrEqual
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
greaterThanOrEqual
(
secondViewAttribute
);
constraint
.
lessThanOrEqualTo
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
greaterThanOrEqualTo
(
secondViewAttribute
);
[
verify
(
delegate
)
addConstraint
:(
id
)
constraint
];
[
verify
(
delegate
)
addConstraint
:(
id
)
newConstraint
];
...
...
@@ -81,17 +81,17 @@ describe(@"equality chaining", ^{
});
it
(
@"should return same constraint when encountering lessThanOrEqual for first time"
,
^
{
MASViewConstraint
*
newConstraint
=
constraint
.
lessThanOrEqual
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
lessThanOrEqual
To
(
secondViewAttribute
);
[
verify
(
delegate
)
addConstraint
:(
id
)
constraint
];
expect
(
newConstraint
).
to
.
beIdenticalTo
(
constraint
);
expect
(
constraint
.
secondViewAttribute
).
to
.
beIdenticalTo
(
secondViewAttribute
);
expect
(
constraint
.
layoutRelation
).
to
.
e
x_e
qual
(
NSLayoutRelationLessThanOrEqual
);
expect
(
constraint
.
layoutRelation
).
to
.
equal
(
NSLayoutRelationLessThanOrEqual
);
});
it
(
@"should start new constraint when encountering lessThanOrEqual subsequently"
,
^
{
constraint
.
equal
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
lessThanOrEqual
(
secondViewAttribute
);
constraint
.
equalTo
(
secondViewAttribute
);
MASViewConstraint
*
newConstraint
=
constraint
.
lessThanOrEqualTo
(
secondViewAttribute
);
[
verify
(
delegate
)
addConstraint
:(
id
)
constraint
];
[
verify
(
delegate
)
addConstraint
:(
id
)
newConstraint
];
...
...
@@ -102,7 +102,7 @@ describe(@"equality chaining", ^{
[
constraint
commit
];
expect
(
^
{
constraint
.
equal
(
secondViewAttribute
);
constraint
.
equal
To
(
secondViewAttribute
);
}).
to
.
raise
(
@"NSInternalInconsistencyException"
);
});
...
...
@@ -110,7 +110,7 @@ describe(@"equality chaining", ^{
[
constraint
commit
];
expect
(
^
{
constraint
.
lessThanOrEqual
(
secondViewAttribute
);
constraint
.
lessThanOrEqual
To
(
secondViewAttribute
);
}).
to
.
raise
(
@"NSInternalInconsistencyException"
);
});
...
...
@@ -118,7 +118,7 @@ describe(@"equality chaining", ^{
[
constraint
commit
];
expect
(
^
{
constraint
.
greaterThanOrEqual
(
secondViewAttribute
);
constraint
.
greaterThanOrEqual
To
(
secondViewAttribute
);
}).
to
.
raise
(
@"NSInternalInconsistencyException"
);
});
...
...
@@ -141,8 +141,8 @@ describe(@"multiplier & constant", ^{
[
constraint
commit
];
constraint
.
offset
(
10
);
expect
(
constraint
.
layoutConstant
).
to
.
ex_equal
(
10
);
expect
(
constraint
.
layoutConstraint
.
constant
).
to
.
ex_equal
(
10
);
expect
(
constraint
.
layoutConstant
).
to
.
equal
(
10
);
expect
(
constraint
.
layoutConstraint
.
constant
).
to
.
equal
(
10
);
});
xit
(
@"should update sides only"
,
^
{});
...
...
@@ -155,20 +155,20 @@ describe(@"multiplier & constant", ^{
describe
(
@"commit"
,
^
{
it
(
@"should create layout constraint"
,
^
{
constraint
.
equal
(
secondViewAttribute
);
constraint
.
equal
To
(
secondViewAttribute
);
constraint
.
percent
(
0
.
5
);
constraint
.
offset
(
10
);
constraint
.
priority
(
345
);
[
constraint
commit
];
expect
(
constraint
.
layoutConstraint
.
firstAttribute
).
to
.
ex_equal
(
NSLayoutAttributeWidth
);
expect
(
constraint
.
layoutConstraint
.
secondAttribute
).
to
.
ex_equal
(
NSLayoutAttributeHeight
);
expect
(
constraint
.
layoutConstraint
.
firstAttribute
).
to
.
equal
(
NSLayoutAttributeWidth
);
expect
(
constraint
.
layoutConstraint
.
secondAttribute
).
to
.
equal
(
NSLayoutAttributeHeight
);
expect
(
constraint
.
layoutConstraint
.
firstItem
).
to
.
beIdenticalTo
(
constraint
.
firstViewAttribute
.
view
);
expect
(
constraint
.
layoutConstraint
.
secondItem
).
to
.
beIdenticalTo
(
constraint
.
secondViewAttribute
.
view
);
expect
(
constraint
.
layoutConstraint
.
relation
).
to
.
ex_equal
(
NSLayoutRelationEqual
);
expect
(
constraint
.
layoutConstraint
.
constant
).
to
.
ex_equal
(
10
);
expect
(
constraint
.
layoutConstraint
.
priority
).
to
.
ex_equal
(
345
);
expect
(
constraint
.
layoutConstraint
.
multiplier
).
to
.
ex_equal
(
0
.
5
);
expect
(
constraint
.
layoutConstraint
.
relation
).
to
.
equal
(
NSLayoutRelationEqual
);
expect
(
constraint
.
layoutConstraint
.
constant
).
to
.
equal
(
10
);
expect
(
constraint
.
layoutConstraint
.
priority
).
to
.
equal
(
345
);
expect
(
constraint
.
layoutConstraint
.
multiplier
).
to
.
equal
(
0
.
5
);
[
verify
(
superview
)
addConstraint
:
constraint
.
layoutConstraint
];
});
...
...
MasonryTests/MasonryTests-Prefix.pch
View file @
25376fe
...
...
@@ -9,11 +9,6 @@
#define EXP_SHORTHAND
#import "Expecta.h"
#undef equal
#define ex_equal(expected) _equal(EXPObjectify((expected)))
#define HC_SHORTHAND
#import <OCHamcrest/OCHamcrest.h>
#define MOCKITO_SHORTHAND
#import <OCMockito/OCMockito.h>
...
...
Please
register
or
login
to post a comment