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
Lukas Stabe
11 years ago
Commit
18f57bd68751de5260ffe425cb82db9870e22a2a
1 parent
a8ca8beb
add view.mas_attribute(...)
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
Masonry/View+MASAdditions.h
Masonry/View+MASAdditions.m
Masonry/View+MASShorthandAdditions.h
Masonry/View+MASAdditions.h
View file @
18f57bd
...
...
@@ -30,6 +30,7 @@
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_centerX
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_centerY
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_baseline
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
(
^
mas_attribute
)(
NSLayoutAttribute
attr
);
/**
* a key to associate with this view
...
...
Masonry/View+MASAdditions.m
View file @
18f57bd
...
...
@@ -72,6 +72,13 @@
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
layoutAttribute
:
NSLayoutAttributeBaseline
];
}
-
(
MASViewAttribute
*
(
^
)(
NSLayoutAttribute
))
mas_attribute
{
return
^
(
NSLayoutAttribute
attr
)
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
layoutAttribute
:
attr
];
};
}
#pragma mark - associated properties
-
(
id
)
mas_key
{
...
...
Masonry/View+MASShorthandAdditions.h
View file @
18f57bd
...
...
@@ -27,6 +27,7 @@
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
centerX
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
centerY
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
baseline
;
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
(
^
attribute
)(
NSLayoutAttribute
attr
);
-
(
NSArray
*
)
makeConstraints
:(
void
(
^
)(
MASConstraintMaker
*
make
))
block
;
-
(
NSArray
*
)
updateConstraints
:(
void
(
^
)(
MASConstraintMaker
*
make
))
block
;
...
...
@@ -51,6 +52,7 @@ MAS_ATTR_FORWARD(height);
MAS_ATTR_FORWARD
(
centerX
)
;
MAS_ATTR_FORWARD
(
centerY
)
;
MAS_ATTR_FORWARD
(
baseline
)
;
MAS_ATTR_FORWARD
(
attribute
)
;
-
(
NSArray
*
)
makeConstraints
:
(
void
(
^
)(
MASConstraintMaker
*
))
block
{
return
[
self
mas_makeConstraints
:
block
];
...
...
Please
register
or
login
to post a comment