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
Plain Diff
Browse Files
Authored by
Jonas Budelmann
11 years ago
Commit
9806c36a0dccc304e71ed40b2a524c8fba3b4cd0
2 parents
1a20aee5
a5514d38
Merge pull request #41 from pfandrade/upstream
Adding support for the animator proxy on OS X
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
Masonry/MASCompositeConstraint.m
Masonry/MASConstraint.h
Masonry/MASViewConstraint.m
Masonry/MASCompositeConstraint.m
View file @
9806c36
...
...
@@ -165,6 +165,19 @@
return
self
;
}
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
-
(
id
<
MASConstraint
>
)
animator
{
for
(
id
<
MASConstraint
>
constraint
in
self
.
childConstraints
)
{
[
constraint
animator
];
}
return
self
;
}
#endif
#pragma mark - debug helpers
-
(
id
<
MASConstraint
>
(
^
)(
id
))
key
{
...
...
Masonry/MASConstraint.h
View file @
9806c36
...
...
@@ -113,6 +113,13 @@
*/
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
(
^
key
)(
id
key
);
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
/**
* Whether or not to go through the animator proxy when modifying the constraint
*/
@property
(
nonatomic
,
copy
,
readonly
)
id
<
MASConstraint
>
animator
;
#endif
/**
* Whether or not to check for an existing constraint instead of adding constraint
*/
...
...
Masonry/MASViewConstraint.m
View file @
9806c36
...
...
@@ -22,6 +22,7 @@
@property
(
nonatomic
,
assign
)
CGFloat
layoutConstant
;
@property
(
nonatomic
,
assign
)
BOOL
hasLayoutRelation
;
@property
(
nonatomic
,
strong
)
id
mas_key
;
@property
(
nonatomic
,
assign
)
BOOL
useAnimator
;
@end
...
...
@@ -57,7 +58,16 @@
-
(
void
)
setLayoutConstant
:(
CGFloat
)
layoutConstant
{
_layoutConstant
=
layoutConstant
;
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
if
(
self
.
useAnimator
)
{
self
.
layoutConstraint
.
animator
.
constant
=
layoutConstant
;
}
else
{
self
.
layoutConstraint
.
constant
=
layoutConstant
;
}
#else
self
.
layoutConstraint
.
constant
=
layoutConstant
;
#endif
}
-
(
void
)
setLayoutRelation
:(
NSLayoutRelation
)
layoutRelation
{
...
...
@@ -247,6 +257,17 @@
return
self
;
}
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
-
(
id
<
MASConstraint
>
)
animator
{
self
.
useAnimator
=
YES
;
return
self
;
}
#endif
#pragma mark - debug helpers
-
(
id
<
MASConstraint
>
(
^
)(
id
))
key
{
...
...
Please
register
or
login
to post a comment