-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added category for getting the MASViewAttributes from a view controll…
…er for the layout guides.
- Loading branch information
1 parent
e15b3a6
commit c99e65c
Showing
6 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// UIViewController+MASAdditions.h | ||
// Masonry | ||
// | ||
// Created by Craig Siemens on 2015-06-23. | ||
// | ||
// | ||
|
||
#import "MASUtilities.h" | ||
#import "MASConstraintMaker.h" | ||
#import "MASViewAttribute.h" | ||
|
||
#ifdef MAS_VIEW_CONTROLLER | ||
|
||
@interface MAS_VIEW_CONTROLLER (MASAdditions) | ||
|
||
/** | ||
* following properties return a new MASViewAttribute with appropriate UILa 8youtGuide and NSLayoutAttribute | ||
*/ | ||
@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; | ||
@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// UIViewController+MASAdditions.m | ||
// Masonry | ||
// | ||
// Created by Craig Siemens on 2015-06-23. | ||
// | ||
// | ||
|
||
#import "ViewController+MASAdditions.h" | ||
|
||
#ifdef MAS_VIEW_CONTROLLER | ||
|
||
@implementation MAS_VIEW_CONTROLLER (MASAdditions) | ||
|
||
- (MASViewAttribute *)mas_topLayoutGuide { | ||
return [[MASViewAttribute alloc] initWithView:(UIView *)self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; | ||
} | ||
|
||
- (MASViewAttribute *)mas_bottomLayoutGuide { | ||
return [[MASViewAttribute alloc] initWithView:(UIView *)self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; | ||
} | ||
|
||
@end | ||
|
||
#endif |