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
cntrump
8 years ago
Commit
ca26cb1426fca2b61ba92702f544265e0bd01243
1 parent
7528f5be
support safeAreaLayoutGuide of iOS 11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
Masonry/View+MASAdditions.h
Masonry/View+MASAdditions.m
Masonry/View+MASShorthandAdditions.h
Masonry/View+MASAdditions.h
View file @
ca26cb1
...
...
@@ -52,6 +52,16 @@
#endif
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_safeAreaLayoutGuide
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_safeAreaLayoutGuideTop
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_safeAreaLayoutGuideBottom
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_safeAreaLayoutGuideLeft
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
mas_safeAreaLayoutGuideRight
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
#endif
/**
* a key to associate with this view
*/
...
...
Masonry/View+MASAdditions.m
View file @
ca26cb1
...
...
@@ -134,6 +134,26 @@
#endif
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
-
(
MASViewAttribute
*
)
mas_safeAreaLayoutGuide
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
item
:
self
.
safeAreaLayoutGuide
layoutAttribute
:
NSLayoutAttributeBottom
];
}
-
(
MASViewAttribute
*
)
mas_safeAreaLayoutGuideTop
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
item
:
self
.
safeAreaLayoutGuide
layoutAttribute
:
NSLayoutAttributeTop
];
}
-
(
MASViewAttribute
*
)
mas_safeAreaLayoutGuideBottom
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
item
:
self
.
safeAreaLayoutGuide
layoutAttribute
:
NSLayoutAttributeBottom
];
}
-
(
MASViewAttribute
*
)
mas_safeAreaLayoutGuideLeft
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
item
:
self
.
safeAreaLayoutGuide
layoutAttribute
:
NSLayoutAttributeLeft
];
}
-
(
MASViewAttribute
*
)
mas_safeAreaLayoutGuideRight
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
item
:
self
.
safeAreaLayoutGuide
layoutAttribute
:
NSLayoutAttributeRight
];
}
#endif
#pragma mark - associated properties
-
(
id
)
mas_key
{
...
...
Masonry/View+MASShorthandAdditions.h
View file @
ca26cb1
...
...
@@ -49,6 +49,15 @@
#endif
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
safeAreaLayoutGuideTop
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
safeAreaLayoutGuideBottom
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
safeAreaLayoutGuideLeft
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
@property
(
nonatomic
,
strong
,
readonly
)
MASViewAttribute
*
safeAreaLayoutGuideRight
API_AVAILABLE
(
ios
(
11
.
0
),
tvos
(
11
.
0
));
#endif
-
(
NSArray
*
)
makeConstraints
:(
void
(
^
)(
MASConstraintMaker
*
make
))
block
;
-
(
NSArray
*
)
updateConstraints
:(
void
(
^
)(
MASConstraintMaker
*
make
))
block
;
-
(
NSArray
*
)
remakeConstraints
:(
void
(
^
)(
MASConstraintMaker
*
make
))
block
;
...
...
@@ -94,6 +103,15 @@ MAS_ATTR_FORWARD(centerYWithinMargins);
#endif
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
MAS_ATTR_FORWARD
(
safeAreaLayoutGuideTop
)
;
MAS_ATTR_FORWARD
(
safeAreaLayoutGuideBottom
)
;
MAS_ATTR_FORWARD
(
safeAreaLayoutGuideLeft
)
;
MAS_ATTR_FORWARD
(
safeAreaLayoutGuideRight
)
;
#endif
-
(
MASViewAttribute
*
(
^
)(
NSLayoutAttribute
))
attribute
{
return
[
self
mas_attribute
];
}
...
...
Please
register
or
login
to post a comment