Permalink
Browse files

Added category for getting the MASViewAttributes from a view controll…

…er for the layout guides.
  • Loading branch information...
CraigSiemens committed Jun 23, 2015
1 parent e15b3a6 commit c99e65c2eb40a02106d87a1487f96c0f4b1b72c0
@@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD52F1A9179CA93B005CD195"
BuildableName = "libMasonry.a"
BlueprintIdentifier = "3AED05B61AD59FD40053CC65"
BuildableName = "Masonry.framework"
BlueprintName = "Masonry iOS"
ReferencedContainer = "container:../Masonry.xcodeproj">
</BuildableReference>
@@ -62,7 +62,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD52F226179CAD57005CD195"
@@ -80,7 +81,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DD52F226179CAD57005CD195"
@@ -53,6 +53,8 @@
3AED06201AD5A1400053CC65 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DC1AD5A0470053CC65 /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
3AED06211AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05ED1AD5A0470053CC65 /* NSLayoutConstraint+MASDebugAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
3AED06221AD5A1400053CC65 /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DE1AD5A0470053CC65 /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
4473548D1B39F772004DACCB /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */; };
4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -82,6 +84,8 @@
3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "View+MASAdditions.m"; sourceTree = "<group>"; };
3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASShorthandAdditions.h"; sourceTree = "<group>"; };
3AED06271AD5A1400053CC65 /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ViewController+MASAdditions.h"; sourceTree = "<group>"; };
4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ViewController+MASAdditions.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -127,6 +131,8 @@
3AED05EF1AD5A0470053CC65 /* View+MASAdditions.h */,
3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */,
3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */,
4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */,
4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */,
3AED05EA1AD5A0470053CC65 /* NSArray+MASAdditions.h */,
3AED05EB1AD5A0470053CC65 /* NSArray+MASAdditions.m */,
3AED05EC1AD5A0470053CC65 /* NSArray+MASShorthandAdditions.h */,
@@ -167,6 +173,7 @@
files = (
3AED06051AD5A0470053CC65 /* View+MASAdditions.h in Headers */,
3AED06071AD5A0470053CC65 /* View+MASShorthandAdditions.h in Headers */,
4473548D1B39F772004DACCB /* ViewController+MASAdditions.h in Headers */,
3AED05FC1AD5A0470053CC65 /* MASViewAttribute.h in Headers */,
3AED05BD1AD59FD40053CC65 /* Masonry.h in Headers */,
3AED05F91AD5A0470053CC65 /* MASLayoutConstraint.h in Headers */,
@@ -298,6 +305,7 @@
files = (
3AED06011AD5A0470053CC65 /* NSArray+MASAdditions.m in Sources */,
3AED05FD1AD5A0470053CC65 /* MASViewAttribute.m in Sources */,
4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */,
3AED05FA1AD5A0470053CC65 /* MASLayoutConstraint.m in Sources */,
3AED05F51AD5A0470053CC65 /* MASConstraint.m in Sources */,
3AED05FF1AD5A0470053CC65 /* MASViewConstraint.m in Sources */,
View
@@ -12,6 +12,7 @@
#import <UIKit/UIKit.h>
#define MAS_VIEW UIView
#define MAS_VIEW_CONTROLLER UIViewController
#define MASEdgeInsets UIEdgeInsets
typedef UILayoutPriority MASLayoutPriority;
View
@@ -17,6 +17,7 @@ FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
#import "MASUtilities.h"
#import "View+MASAdditions.h"
#import "View+MASShorthandAdditions.h"
#import "ViewController+MASAdditions.h"
#import "NSArray+MASAdditions.h"
#import "NSArray+MASShorthandAdditions.h"
#import "MASConstraint.h"
@@ -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
@@ -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

0 comments on commit c99e65c

Please sign in to comment.