-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support UIViewController's topLayoutGuide and bottomLayoutGuide
This improves the API for using topLayoutGuide and bottomLayoutGuide via Masonry, and fixes crashes in iOS 9 from assuming that the topLayoutGuide and bottomLayoutGuide are UIViews
- Loading branch information
1 parent
e15b3a6
commit 6d9e157
Showing
6 changed files
with
57 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// ViewController_MASAdditions.h | ||
// Masonry | ||
// | ||
// Created by Ray Lillywhite on 6/23/15. | ||
// Copyright © 2015 Jonas Budelmann. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#if TARGET_OS_IPHONE | ||
#import <UIKit/UIKit.h> | ||
@class MASViewAttribute; | ||
@interface UIViewController (MASAdditions) | ||
|
||
@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,24 @@ | ||
// | ||
// NSObject+ViewController_MASAdditions.m | ||
// Masonry | ||
// | ||
// Created by Ray Lillywhite on 6/23/15. | ||
// Copyright © 2015 Jonas Budelmann. All rights reserved. | ||
// | ||
|
||
#import "ViewController+MASAdditions.h" | ||
#import "MASViewConstraint.h" | ||
|
||
#if TARGET_OS_IPHONE | ||
@implementation UIViewController (MASAdditions) | ||
|
||
- (MASViewAttribute *)mas_topLayoutGuide { | ||
return [[MASViewAttribute alloc] initWithView:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; | ||
} | ||
|
||
- (MASViewAttribute *)mas_bottomLayoutGuide { | ||
return [[MASViewAttribute alloc] initWithView:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; | ||
} | ||
|
||
@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