Authored by Craig Siemens

Added category for getting the MASViewAttributes from a view controller for the layout guides.

@@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
14 buildForAnalyzing = "YES"> 14 buildForAnalyzing = "YES">
15 <BuildableReference 15 <BuildableReference
16 BuildableIdentifier = "primary" 16 BuildableIdentifier = "primary"
17 - BlueprintIdentifier = "DD52F1A9179CA93B005CD195"  
18 - BuildableName = "libMasonry.a" 17 + BlueprintIdentifier = "3AED05B61AD59FD40053CC65"
  18 + BuildableName = "Masonry.framework"
19 BlueprintName = "Masonry iOS" 19 BlueprintName = "Masonry iOS"
20 ReferencedContainer = "container:../Masonry.xcodeproj"> 20 ReferencedContainer = "container:../Masonry.xcodeproj">
21 </BuildableReference> 21 </BuildableReference>
@@ -62,7 +62,8 @@ @@ -62,7 +62,8 @@
62 ignoresPersistentStateOnLaunch = "NO" 62 ignoresPersistentStateOnLaunch = "NO"
63 debugDocumentVersioning = "YES" 63 debugDocumentVersioning = "YES"
64 allowLocationSimulation = "YES"> 64 allowLocationSimulation = "YES">
65 - <BuildableProductRunnable> 65 + <BuildableProductRunnable
  66 + runnableDebuggingMode = "0">
66 <BuildableReference 67 <BuildableReference
67 BuildableIdentifier = "primary" 68 BuildableIdentifier = "primary"
68 BlueprintIdentifier = "DD52F226179CAD57005CD195" 69 BlueprintIdentifier = "DD52F226179CAD57005CD195"
@@ -80,7 +81,8 @@ @@ -80,7 +81,8 @@
80 useCustomWorkingDirectory = "NO" 81 useCustomWorkingDirectory = "NO"
81 buildConfiguration = "Release" 82 buildConfiguration = "Release"
82 debugDocumentVersioning = "YES"> 83 debugDocumentVersioning = "YES">
83 - <BuildableProductRunnable> 84 + <BuildableProductRunnable
  85 + runnableDebuggingMode = "0">
84 <BuildableReference 86 <BuildableReference
85 BuildableIdentifier = "primary" 87 BuildableIdentifier = "primary"
86 BlueprintIdentifier = "DD52F226179CAD57005CD195" 88 BlueprintIdentifier = "DD52F226179CAD57005CD195"
@@ -53,6 +53,8 @@ @@ -53,6 +53,8 @@
53 3AED06201AD5A1400053CC65 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DC1AD5A0470053CC65 /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53 3AED06201AD5A1400053CC65 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DC1AD5A0470053CC65 /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
54 3AED06211AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05ED1AD5A0470053CC65 /* NSLayoutConstraint+MASDebugAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 54 3AED06211AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05ED1AD5A0470053CC65 /* NSLayoutConstraint+MASDebugAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
55 3AED06221AD5A1400053CC65 /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DE1AD5A0470053CC65 /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; 55 3AED06221AD5A1400053CC65 /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DE1AD5A0470053CC65 /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
  56 + 4473548D1B39F772004DACCB /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */; };
  57 + 4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */; };
56 /* End PBXBuildFile section */ 58 /* End PBXBuildFile section */
57 59
58 /* Begin PBXFileReference section */ 60 /* Begin PBXFileReference section */
@@ -82,6 +84,8 @@ @@ -82,6 +84,8 @@
82 3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "View+MASAdditions.m"; sourceTree = "<group>"; }; 84 3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "View+MASAdditions.m"; sourceTree = "<group>"; };
83 3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASShorthandAdditions.h"; sourceTree = "<group>"; }; 85 3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASShorthandAdditions.h"; sourceTree = "<group>"; };
84 3AED06271AD5A1400053CC65 /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 86 3AED06271AD5A1400053CC65 /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; };
  87 + 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ViewController+MASAdditions.h"; sourceTree = "<group>"; };
  88 + 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ViewController+MASAdditions.m"; sourceTree = "<group>"; };
85 /* End PBXFileReference section */ 89 /* End PBXFileReference section */
86 90
87 /* Begin PBXFrameworksBuildPhase section */ 91 /* Begin PBXFrameworksBuildPhase section */
@@ -127,6 +131,8 @@ @@ -127,6 +131,8 @@
127 3AED05EF1AD5A0470053CC65 /* View+MASAdditions.h */, 131 3AED05EF1AD5A0470053CC65 /* View+MASAdditions.h */,
128 3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */, 132 3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */,
129 3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */, 133 3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */,
  134 + 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */,
  135 + 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */,
130 3AED05EA1AD5A0470053CC65 /* NSArray+MASAdditions.h */, 136 3AED05EA1AD5A0470053CC65 /* NSArray+MASAdditions.h */,
131 3AED05EB1AD5A0470053CC65 /* NSArray+MASAdditions.m */, 137 3AED05EB1AD5A0470053CC65 /* NSArray+MASAdditions.m */,
132 3AED05EC1AD5A0470053CC65 /* NSArray+MASShorthandAdditions.h */, 138 3AED05EC1AD5A0470053CC65 /* NSArray+MASShorthandAdditions.h */,
@@ -167,6 +173,7 @@ @@ -167,6 +173,7 @@
167 files = ( 173 files = (
168 3AED06051AD5A0470053CC65 /* View+MASAdditions.h in Headers */, 174 3AED06051AD5A0470053CC65 /* View+MASAdditions.h in Headers */,
169 3AED06071AD5A0470053CC65 /* View+MASShorthandAdditions.h in Headers */, 175 3AED06071AD5A0470053CC65 /* View+MASShorthandAdditions.h in Headers */,
  176 + 4473548D1B39F772004DACCB /* ViewController+MASAdditions.h in Headers */,
170 3AED05FC1AD5A0470053CC65 /* MASViewAttribute.h in Headers */, 177 3AED05FC1AD5A0470053CC65 /* MASViewAttribute.h in Headers */,
171 3AED05BD1AD59FD40053CC65 /* Masonry.h in Headers */, 178 3AED05BD1AD59FD40053CC65 /* Masonry.h in Headers */,
172 3AED05F91AD5A0470053CC65 /* MASLayoutConstraint.h in Headers */, 179 3AED05F91AD5A0470053CC65 /* MASLayoutConstraint.h in Headers */,
@@ -298,6 +305,7 @@ @@ -298,6 +305,7 @@
298 files = ( 305 files = (
299 3AED06011AD5A0470053CC65 /* NSArray+MASAdditions.m in Sources */, 306 3AED06011AD5A0470053CC65 /* NSArray+MASAdditions.m in Sources */,
300 3AED05FD1AD5A0470053CC65 /* MASViewAttribute.m in Sources */, 307 3AED05FD1AD5A0470053CC65 /* MASViewAttribute.m in Sources */,
  308 + 4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */,
301 3AED05FA1AD5A0470053CC65 /* MASLayoutConstraint.m in Sources */, 309 3AED05FA1AD5A0470053CC65 /* MASLayoutConstraint.m in Sources */,
302 3AED05F51AD5A0470053CC65 /* MASConstraint.m in Sources */, 310 3AED05F51AD5A0470053CC65 /* MASConstraint.m in Sources */,
303 3AED05FF1AD5A0470053CC65 /* MASViewConstraint.m in Sources */, 311 3AED05FF1AD5A0470053CC65 /* MASViewConstraint.m in Sources */,
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 12
13 #import <UIKit/UIKit.h> 13 #import <UIKit/UIKit.h>
14 #define MAS_VIEW UIView 14 #define MAS_VIEW UIView
  15 + #define MAS_VIEW_CONTROLLER UIViewController
15 #define MASEdgeInsets UIEdgeInsets 16 #define MASEdgeInsets UIEdgeInsets
16 17
17 typedef UILayoutPriority MASLayoutPriority; 18 typedef UILayoutPriority MASLayoutPriority;
@@ -17,6 +17,7 @@ FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; @@ -17,6 +17,7 @@ FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
17 #import "MASUtilities.h" 17 #import "MASUtilities.h"
18 #import "View+MASAdditions.h" 18 #import "View+MASAdditions.h"
19 #import "View+MASShorthandAdditions.h" 19 #import "View+MASShorthandAdditions.h"
  20 +#import "ViewController+MASAdditions.h"
20 #import "NSArray+MASAdditions.h" 21 #import "NSArray+MASAdditions.h"
21 #import "NSArray+MASShorthandAdditions.h" 22 #import "NSArray+MASShorthandAdditions.h"
22 #import "MASConstraint.h" 23 #import "MASConstraint.h"
  1 +//
  2 +// UIViewController+MASAdditions.h
  3 +// Masonry
  4 +//
  5 +// Created by Craig Siemens on 2015-06-23.
  6 +//
  7 +//
  8 +
  9 +#import "MASUtilities.h"
  10 +#import "MASConstraintMaker.h"
  11 +#import "MASViewAttribute.h"
  12 +
  13 +#ifdef MAS_VIEW_CONTROLLER
  14 +
  15 +@interface MAS_VIEW_CONTROLLER (MASAdditions)
  16 +
  17 +/**
  18 + * following properties return a new MASViewAttribute with appropriate UILa 8youtGuide and NSLayoutAttribute
  19 + */
  20 +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide;
  21 +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide;
  22 +
  23 +@end
  24 +
  25 +#endif
  1 +//
  2 +// UIViewController+MASAdditions.m
  3 +// Masonry
  4 +//
  5 +// Created by Craig Siemens on 2015-06-23.
  6 +//
  7 +//
  8 +
  9 +#import "ViewController+MASAdditions.h"
  10 +
  11 +#ifdef MAS_VIEW_CONTROLLER
  12 +
  13 +@implementation MAS_VIEW_CONTROLLER (MASAdditions)
  14 +
  15 +- (MASViewAttribute *)mas_topLayoutGuide {
  16 + return [[MASViewAttribute alloc] initWithView:(UIView *)self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
  17 +}
  18 +
  19 +- (MASViewAttribute *)mas_bottomLayoutGuide {
  20 + return [[MASViewAttribute alloc] initWithView:(UIView *)self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
  21 +}
  22 +
  23 +@end
  24 +
  25 +#endif