diff --git a/Examples/Masonry iOS Examples.xcodeproj/project.pbxproj b/Examples/Masonry iOS Examples.xcodeproj/project.pbxproj index 8ea63a4f..a084fa9f 100644 --- a/Examples/Masonry iOS Examples.xcodeproj/project.pbxproj +++ b/Examples/Masonry iOS Examples.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ 00FC4A321B7359D700DCA999 /* MASExampleDistributeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00FC4A311B7359D700DCA999 /* MASExampleDistributeView.m */; }; + 106A947E24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106A947D24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.m */; }; + 114413091924B6EE008E702E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 114413081924B6EE008E702E /* Default-568h@2x.png */; }; 27A27D461A6CF0C400D34F52 /* MASExampleAspectFitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27A27D451A6CF0C400D34F52 /* MASExampleAspectFitView.m */; }; 3C02224919D0C4EC00507321 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C02224819D0C4EC00507321 /* Images.xcassets */; }; 3DB1CAD5184538E200E91FC5 /* MASExampleArrayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB1CAD4184538E200E91FC5 /* MASExampleArrayView.m */; }; @@ -39,6 +41,8 @@ /* Begin PBXFileReference section */ 00FC4A301B7359D700DCA999 /* MASExampleDistributeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleDistributeView.h; sourceTree = ""; }; 00FC4A311B7359D700DCA999 /* MASExampleDistributeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleDistributeView.m; sourceTree = ""; }; + 106A947C24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MASExampleLayoutGuideView.h; sourceTree = ""; }; + 106A947D24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MASExampleLayoutGuideView.m; sourceTree = ""; }; 27A27D441A6CF0C400D34F52 /* MASExampleAspectFitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleAspectFitView.h; sourceTree = ""; }; 27A27D451A6CF0C400D34F52 /* MASExampleAspectFitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleAspectFitView.m; sourceTree = ""; }; 321AA59CF7B045B6D503D2E5 /* Pods-Masonry iOS Examples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Masonry iOS Examples.release.xcconfig"; path = "../Pods/Target Support Files/Pods-Masonry iOS Examples/Pods-Masonry iOS Examples.release.xcconfig"; sourceTree = ""; }; @@ -190,6 +194,8 @@ 44C0E6AE1A9B9C55003C70CF /* MASExampleMarginView.m */, 00FC4A301B7359D700DCA999 /* MASExampleDistributeView.h */, 00FC4A311B7359D700DCA999 /* MASExampleDistributeView.m */, + 106A947C24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.h */, + 106A947D24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.m */, ); name = Views; sourceTree = ""; @@ -343,6 +349,7 @@ 3DB1CAD5184538E200E91FC5 /* MASExampleArrayView.m in Sources */, DD52F23B179CAD57005CD195 /* MASAppDelegate.m in Sources */, DD52F251179CADC0005CD195 /* MASExampleBasicView.m in Sources */, + 106A947E24F4C18B00F7A2D5 /* MASExampleLayoutGuideView.m in Sources */, 44C0E6AF1A9B9C55003C70CF /* MASExampleMarginView.m in Sources */, DD653E4A1843E61500D1EC5A /* MASExampleLayoutGuideViewController.m in Sources */, DDDF60CC181915E300BF7B8B /* MASExampleLabelView.m in Sources */, diff --git a/Examples/Masonry iOS Examples/MASExampleLayoutGuideView.h b/Examples/Masonry iOS Examples/MASExampleLayoutGuideView.h new file mode 100644 index 00000000..5f8463a1 --- /dev/null +++ b/Examples/Masonry iOS Examples/MASExampleLayoutGuideView.h @@ -0,0 +1,17 @@ +// +// MASExampleLayoutGuideView.h +// Masonry iOS Examples +// +// Created by zhiqiang_ye on 2020/8/25. +// Copyright © 2020 Jonas Budelmann. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MASExampleLayoutGuideView : MAS_VIEW + +@end + +NS_ASSUME_NONNULL_END diff --git a/Examples/Masonry iOS Examples/MASExampleLayoutGuideView.m b/Examples/Masonry iOS Examples/MASExampleLayoutGuideView.m new file mode 100644 index 00000000..269049c1 --- /dev/null +++ b/Examples/Masonry iOS Examples/MASExampleLayoutGuideView.m @@ -0,0 +1,78 @@ +// +// MASExampleLayoutGuideView.m +// Masonry iOS Examples +// +// Created by zhiqiang_ye on 2020/8/25. +// Copyright © 2020 Jonas Budelmann. All rights reserved. +// + +#import "MASExampleLayoutGuideView.h" + +@implementation MASExampleLayoutGuideView + +#ifdef MAS_LAYOUT_GUIDE + +- (id)init { + self = [super init]; + if (!self) return nil; + + [self example1]; + + return self; +} + +- (void)example1{ + + MAS_VIEW *contentView = MAS_VIEW.new; + contentView.backgroundColor = self.randomColor; + contentView.layer.borderColor = self.randomColor.CGColor; + contentView.layer.borderWidth = 2; + [self addSubview:contentView]; + + MAS_VIEW *leftView = MAS_VIEW.new; + leftView.backgroundColor = self.randomColor; + leftView.layer.borderColor = self.randomColor.CGColor; + leftView.layer.borderWidth = 2; + [contentView addSubview:leftView]; + + MAS_VIEW *rightView = MAS_VIEW.new; + rightView.backgroundColor = self.randomColor; + rightView.layer.borderColor = self.randomColor.CGColor; + rightView.layer.borderWidth = 2; + [contentView addSubview:rightView]; + + [contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.equalToSuperview(); + make.height.mas_equalTo(self.mas_height).multipliedBy(0.3); + }]; + + MAS_LAYOUT_GUIDE *layout = [MAS_LAYOUT_GUIDE mas_allocWithOwningView:contentView]; + [layout mas_makeConstraints:^(MASConstraintMaker * _Nonnull make) { + make.center.equalToSuperview(); + make.size.mas_equalTo(CGSizeMake(60, 60)); + }]; + + [leftView makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(layout); + make.right.mas_equalTo(layout.mas_left); + make.bottom.mas_equalTo(layout); + make.width.mas_equalTo(layout.mas_width); + }]; + + [rightView makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(layout); + make.left.mas_equalTo(layout.mas_right); + make.bottom.mas_equalTo(layout); + make.width.mas_equalTo(layout.mas_width); + }]; +} + +#endif + +- (UIColor *)randomColor { + CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0 + CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white + CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black + return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; +} +@end diff --git a/Examples/Masonry iOS Examples/MASExampleListViewController.m b/Examples/Masonry iOS Examples/MASExampleListViewController.m index 7e3d05c5..9ae29da1 100644 --- a/Examples/Masonry iOS Examples/MASExampleListViewController.m +++ b/Examples/Masonry iOS Examples/MASExampleListViewController.m @@ -24,6 +24,7 @@ #import "MASExampleAspectFitView.h" #import "MASExampleMarginView.h" #import "MASExampleDistributeView.h" +#import "MASExampleLayoutGuideView.h" static NSString * const kMASCellReuseIdentifier = @"kMASCellReuseIdentifier"; @@ -83,6 +84,10 @@ - (id)init { self.exampleControllers = [self.exampleControllers arrayByAddingObject:[[MASExampleSafeAreaLayoutGuideViewController alloc] init]]; } + #ifdef MAS_LAYOUT_GUIDE + self.exampleControllers = [self.exampleControllers arrayByAddingObject:[[MASExampleViewController alloc] initWithTitle:@"Layout Guide" + viewClass:MASExampleLayoutGuideView.class]]; + #endif return self; } diff --git a/Masonry.xcodeproj/project.pbxproj b/Masonry.xcodeproj/project.pbxproj index 1d7d2dab..9d0b75f9 100644 --- a/Masonry.xcodeproj/project.pbxproj +++ b/Masonry.xcodeproj/project.pbxproj @@ -7,6 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 106A947824F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 106A947624F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 106A947924F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 106A947724F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.m */; }; + 106A947A24F4BD8D00F7A2D5 /* LayoutGuide+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 106A947624F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 106A947B24F4BD9500F7A2D5 /* LayoutGuide+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 106A947724F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.m */; }; + 106A949324F4FC8B00F7A2D5 /* MASItemConstraintAdditions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 106A949124F4FC8B00F7A2D5 /* MASItemConstraintAdditions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1091037F24F7879A007EEB46 /* MASItemConstraintAdditions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 106A949124F4FC8B00F7A2D5 /* MASItemConstraintAdditions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3AED05BD1AD59FD40053CC65 /* Masonry.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05BC1AD59FD40053CC65 /* Masonry.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3AED05F21AD5A0470053CC65 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DC1AD5A0470053CC65 /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3AED05F31AD5A0470053CC65 /* MASCompositeConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AED05DD1AD5A0470053CC65 /* MASCompositeConstraint.m */; }; @@ -60,6 +66,9 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 106A947624F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LayoutGuide+MASAdditions.h"; sourceTree = ""; }; + 106A947724F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "LayoutGuide+MASAdditions.m"; sourceTree = ""; }; + 106A949124F4FC8B00F7A2D5 /* MASItemConstraintAdditions+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MASItemConstraintAdditions+Private.h"; sourceTree = ""; }; 3AED05B71AD59FD40053CC65 /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3AED05BB1AD59FD40053CC65 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3AED05BC1AD59FD40053CC65 /* Masonry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Masonry.h; sourceTree = ""; }; @@ -130,8 +139,11 @@ children = ( 3AED05BC1AD59FD40053CC65 /* Masonry.h */, 3AED05E51AD5A0470053CC65 /* MASUtilities.h */, + 106A949124F4FC8B00F7A2D5 /* MASItemConstraintAdditions+Private.h */, 3AED05EF1AD5A0470053CC65 /* View+MASAdditions.h */, 3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */, + 106A947624F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.h */, + 106A947724F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.m */, 3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */, 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */, 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */, @@ -186,7 +198,9 @@ 3AED06001AD5A0470053CC65 /* NSArray+MASAdditions.h in Headers */, 3AED05F21AD5A0470053CC65 /* MASCompositeConstraint.h in Headers */, 3AED05F61AD5A0470053CC65 /* MASConstraint+Private.h in Headers */, + 106A947824F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.h in Headers */, 3AED05F41AD5A0470053CC65 /* MASConstraint.h in Headers */, + 106A949324F4FC8B00F7A2D5 /* MASItemConstraintAdditions+Private.h in Headers */, 3AED06031AD5A0470053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -197,6 +211,7 @@ files = ( 3AED06151AD5A1400053CC65 /* View+MASAdditions.h in Headers */, 3AED06161AD5A1400053CC65 /* View+MASShorthandAdditions.h in Headers */, + 1091037F24F7879A007EEB46 /* MASItemConstraintAdditions+Private.h in Headers */, 3AED06171AD5A1400053CC65 /* MASViewAttribute.h in Headers */, 3AED06181AD5A1400053CC65 /* Masonry.h in Headers */, 3AED06191AD5A1400053CC65 /* MASLayoutConstraint.h in Headers */, @@ -208,6 +223,7 @@ 3AED06201AD5A1400053CC65 /* MASCompositeConstraint.h in Headers */, 447354931B3A18B9004DACCB /* ViewController+MASAdditions.h in Headers */, 3AED06221AD5A1400053CC65 /* MASConstraint.h in Headers */, + 106A947A24F4BD8D00F7A2D5 /* LayoutGuide+MASAdditions.h in Headers */, 3AED061D1AD5A1400053CC65 /* MASConstraint+Private.h in Headers */, 3AED06211AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */, ); @@ -271,6 +287,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 3AED05AD1AD59FD40053CC65; @@ -311,6 +328,7 @@ 4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */, 3AED05FA1AD5A0470053CC65 /* MASLayoutConstraint.m in Sources */, 3AED05F51AD5A0470053CC65 /* MASConstraint.m in Sources */, + 106A947924F4AC8E00F7A2D5 /* LayoutGuide+MASAdditions.m in Sources */, 3AED05FF1AD5A0470053CC65 /* MASViewConstraint.m in Sources */, 3AED05F31AD5A0470053CC65 /* MASCompositeConstraint.m in Sources */, 3AED05F81AD5A0470053CC65 /* MASConstraintMaker.m in Sources */, @@ -331,6 +349,7 @@ 3AED060F1AD5A1400053CC65 /* MASCompositeConstraint.m in Sources */, 447354921B3A18B3004DACCB /* ViewController+MASAdditions.m in Sources */, 3AED06101AD5A1400053CC65 /* MASConstraintMaker.m in Sources */, + 106A947B24F4BD9500F7A2D5 /* LayoutGuide+MASAdditions.m in Sources */, 3AED06111AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */, 3AED06121AD5A1400053CC65 /* View+MASAdditions.m in Sources */, ); diff --git a/Masonry/LayoutGuide+MASAdditions.h b/Masonry/LayoutGuide+MASAdditions.h new file mode 100644 index 00000000..0466cd76 --- /dev/null +++ b/Masonry/LayoutGuide+MASAdditions.h @@ -0,0 +1,96 @@ +// +// UILayoutGuide+MASAdditions.h +// Masonry iOS +// +// Created by zhiqiang_ye on 2020/8/25. +// Copyright © 2020 Jonas Budelmann. All rights reserved. +// + +#import "MASUtilities.h" +#ifdef MAS_LAYOUT_GUIDE +#import "MASConstraintMaker.h" +#import "MASViewAttribute.h" + +NS_ASSUME_NONNULL_BEGIN +/** + * Provides constraint maker block + * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs + */ + +@interface MAS_LAYOUT_GUIDE (MASAdditions) + +/** + * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute + */ +@property (nonatomic, strong, readonly) MASViewAttribute *mas_left; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_top; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_right; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_width; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_height; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; +@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; + +/** + * a key to associate with this layout guide + */ +@property (nonatomic, strong) id mas_key; + +/** + * Convenience initializer. + */ ++ (id)mas_allocWithOwningView:(MAS_VIEW *)owningView; + +/** + * Creates a MASConstraintMaker with the callee layout guide. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing + * + * @param block scope within which you can build up the constraints which you wish to apply to the layout guide. + * + * @return Array of created MASConstraints + */ +- (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * Creates a MASConstraintMaker with the callee layout guide. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. + * If an existing constraint exists then it will be updated instead. + * + * @param block scope within which you can build up the constraints which you wish to apply to the layout guide. + * + * @return Array of created/updated MASConstraints + */ +- (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * Creates a MASConstraintMaker with the callee layout guide. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. + * All constraints previously installed for the view will be removed. + * + * @param block scope within which you can build up the constraints which you wish to apply to the layout guide. + * + * @return Array of created/updated MASConstraints + */ +- (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; + + +@end + +NS_ASSUME_NONNULL_END +#endif diff --git a/Masonry/LayoutGuide+MASAdditions.m b/Masonry/LayoutGuide+MASAdditions.m new file mode 100644 index 00000000..7727e6ba --- /dev/null +++ b/Masonry/LayoutGuide+MASAdditions.m @@ -0,0 +1,148 @@ +// +// UILayoutGuide+MASAdditions.m +// Masonry iOS +// +// Created by zhiqiang_ye on 2020/8/25. +// Copyright © 2020 Jonas Budelmann. All rights reserved. +// + +#import "LayoutGuide+MASAdditions.h" +#ifdef MAS_LAYOUT_GUIDE +#import + +@implementation MAS_LAYOUT_GUIDE (MASAdditions) + ++ (instancetype)mas_allocWithOwningView:(MAS_VIEW *)owningView{ + MAS_LAYOUT_GUIDE *layoutGuide = [[MAS_LAYOUT_GUIDE alloc] init]; + [owningView addLayoutGuide:layoutGuide]; + return layoutGuide; +} + + +- (NSArray *)mas_makeConstraints:(void(^NS_NOESCAPE)(MASConstraintMaker *))block { + MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithLayoutGuide:self]; + block(constraintMaker); + return [constraintMaker install]; +} + +- (NSArray *)mas_updateConstraints:(void(^NS_NOESCAPE)(MASConstraintMaker *))block { + MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithLayoutGuide:self]; + constraintMaker.updateExisting = YES; + block(constraintMaker); + return [constraintMaker install]; +} + +- (NSArray *)mas_remakeConstraints:(void(^NS_NOESCAPE)(MASConstraintMaker *make))block { + MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithLayoutGuide:self]; + constraintMaker.removeExisting = YES; + block(constraintMaker); + return [constraintMaker install]; +} + +#pragma mark - NSLayoutAttribute properties + +- (MASViewAttribute *)mas_left { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeLeft]; +} + +- (MASViewAttribute *)mas_top { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeTop]; +} + +- (MASViewAttribute *)mas_right { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeRight]; +} + +- (MASViewAttribute *)mas_bottom { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeBottom]; +} + +- (MASViewAttribute *)mas_leading { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeLeading]; +} + +- (MASViewAttribute *)mas_trailing { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeTrailing]; +} + +- (MASViewAttribute *)mas_width { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeWidth]; +} + +- (MASViewAttribute *)mas_height { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeHeight]; +} + +- (MASViewAttribute *)mas_centerX { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeCenterX]; +} + +- (MASViewAttribute *)mas_centerY { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeCenterY]; +} + +- (MASViewAttribute *)mas_baseline { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeBaseline]; +} + +- (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute +{ + return ^(NSLayoutAttribute attr) { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:attr]; + }; +} + +- (MASViewAttribute *)mas_firstBaseline { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeFirstBaseline]; +} +- (MASViewAttribute *)mas_lastBaseline { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeLastBaseline]; +} + +#if TARGET_OS_IPHONE +- (MASViewAttribute *)mas_leftMargin { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeLeftMargin]; +} + +- (MASViewAttribute *)mas_rightMargin { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeRightMargin]; +} + +- (MASViewAttribute *)mas_topMargin { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeTopMargin]; +} + +- (MASViewAttribute *)mas_bottomMargin { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeBottomMargin]; +} + +- (MASViewAttribute *)mas_leadingMargin { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeLeadingMargin]; +} + +- (MASViewAttribute *)mas_trailingMargin { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeTrailingMargin]; +} + +- (MASViewAttribute *)mas_centerXWithinMargins { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins]; +} + +- (MASViewAttribute *)mas_centerYWithinMargins { + return [[MASViewAttribute alloc] initWithView:self.owningView item:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins]; +} + +#endif + +#pragma mark - associated properties + +- (id)mas_key { + return objc_getAssociatedObject(self, @selector(mas_key)); +} + +- (void)setMas_key:(id)key { + objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end +#endif diff --git a/Masonry/MASConstraint.h b/Masonry/MASConstraint.h index 6fea79ee..c4cff303 100644 --- a/Masonry/MASConstraint.h +++ b/Masonry/MASConstraint.h @@ -93,6 +93,13 @@ */ - (MASConstraint * (^)(id attr))equalTo; +/** +* Sets the constraint relation to NSLayoutRelationEqual in the superview +* returns a block which accepts one of the following: +* see readme for more details. +*/ +- (MASConstraint * (^)(void))equalToSuperview; + /** * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual * returns a block which accepts one of the following: @@ -101,6 +108,13 @@ */ - (MASConstraint * (^)(id attr))greaterThanOrEqualTo; +/** + * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual in the superview + * returns a block which accepts one of the following: + * see readme for more details. + */ +- (MASConstraint * (^)(void))greaterThanOrEqualToSuperview; + /** * Sets the constraint relation to NSLayoutRelationLessThanOrEqual * returns a block which accepts one of the following: @@ -109,6 +123,14 @@ */ - (MASConstraint * (^)(id attr))lessThanOrEqualTo; +/** + * Sets the constraint relation to NSLayoutRelationLessThanOrEqual in the superview + * returns a block which accepts one of the following: + * see readme for more details. + */ +- (MASConstraint * (^)(void))lessThanOrEqualToSuperview; + + /** * Optional semantic property which has no effect but improves the readability of constraint */ diff --git a/Masonry/MASConstraint.m b/Masonry/MASConstraint.m index b8841e58..16ad8eaa 100644 --- a/Masonry/MASConstraint.m +++ b/Masonry/MASConstraint.m @@ -7,6 +7,7 @@ #import "MASConstraint.h" #import "MASConstraint+Private.h" +#import "MASViewConstraint.h" #define MASMethodNotImplemented() \ @throw [NSException exceptionWithName:NSInternalInconsistencyException \ @@ -30,6 +31,12 @@ - (id)init { }; } +- (MASConstraint * (^)(void))equalToSuperview { + return ^id (void){ + return self.equalTo(self.superview); + }; +} + - (MASConstraint * (^)(id))mas_equalTo { return ^id(id attribute) { return self.equalToWithRelation(attribute, NSLayoutRelationEqual); @@ -42,6 +49,12 @@ - (id)init { }; } +- (MASConstraint * (^)(void))greaterThanOrEqualToSuperview { + return ^id (void){ + return self.greaterThanOrEqualTo(self.superview); + }; +} + - (MASConstraint * (^)(id))mas_greaterThanOrEqualTo { return ^id(id attribute) { return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); @@ -54,6 +67,12 @@ - (id)init { }; } +- (MASConstraint * (^)(void))lessThanOrEqualToSuperview { + return ^id (void){ + return self.lessThanOrEqualTo(self.superview); + }; +} + - (MASConstraint * (^)(id))mas_lessThanOrEqualTo { return ^id(id attribute) { return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); @@ -258,6 +277,48 @@ - (MASConstraint *)centerYWithinMargins { #endif +#pragma mark - Private +- (MAS_VIEW *)superview{ + if ([self isKindOfClass:[MASViewConstraint class]]) { + MASViewConstraint *viewConstraint = (MASViewConstraint *)self; +#ifdef MAS_LAYOUT_GUIDE + if ([viewConstraint.firstViewAttribute.item isKindOfClass:MAS_LAYOUT_GUIDE.class]) { + MAS_LAYOUT_GUIDE *layout = viewConstraint.firstViewAttribute.item; + if (layout.owningView == viewConstraint.firstViewAttribute.view) { + return layout.owningView; + } + } +#endif + MAS_VIEW *superView = viewConstraint.firstViewAttribute.view.superview; + if (superView) { + return superView; + } + } + if ([self respondsToSelector:@selector(delegate)]) { + id delegate = [self performSelector:@selector(delegate)]; + if (delegate) { +#ifdef MAS_LAYOUT_GUIDE + if ([delegate performSelector:@selector(item)]) { + id item = [delegate performSelector:@selector(item)]; + if ([item isKindOfClass:MAS_LAYOUT_GUIDE.class]) { + MAS_LAYOUT_GUIDE *layout = item; + if (layout.owningView) { + return layout.owningView; + } + } + } +#endif + if ([delegate performSelector:@selector(view)]) { + MAS_VIEW *selfView = [delegate performSelector:@selector(view)]; + if (selfView.superview) { + return selfView.superview; + } + } + } + } + return nil; +} + #pragma mark - Abstract - (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); } diff --git a/Masonry/MASConstraintMaker.h b/Masonry/MASConstraintMaker.h index 9a0bc8df..370ad75c 100644 --- a/Masonry/MASConstraintMaker.h +++ b/Masonry/MASConstraintMaker.h @@ -126,6 +126,17 @@ typedef NS_OPTIONS(NSInteger, MASAttribute) { */ - (id)initWithView:(MAS_VIEW *)view; +#ifdef MAS_LAYOUT_GUIDE +/** + * initialises the maker with a default layout guide + * + * @param layoutGuide any MASConstraint are created with this view as the first item + * + * @return a new MASConstraintMaker + */ +- (id)initWithLayoutGuide:(MAS_LAYOUT_GUIDE *)layoutGuide; +#endif + /** * Calls install method on any MASConstraints which have been created by this maker * diff --git a/Masonry/MASConstraintMaker.m b/Masonry/MASConstraintMaker.m index 26d377be..b94ffe6a 100644 --- a/Masonry/MASConstraintMaker.m +++ b/Masonry/MASConstraintMaker.m @@ -12,12 +12,17 @@ #import "MASConstraint+Private.h" #import "MASViewAttribute.h" #import "View+MASAdditions.h" +#import "MASItemConstraintAdditions+Private.h" @interface MASConstraintMaker () @property (nonatomic, weak) MAS_VIEW *view; @property (nonatomic, strong) NSMutableArray *constraints; +@property (nonatomic, weak) id item; +#ifdef MAS_LAYOUT_GUIDE +@property (nonatomic, weak) MAS_LAYOUT_GUIDE *layoutGuide; +#endif @end @implementation MASConstraintMaker @@ -29,8 +34,22 @@ - (id)initWithView:(MAS_VIEW *)view { self.view = view; self.constraints = NSMutableArray.new; + self.item = (id)view; + return self; +} + +#ifdef MAS_LAYOUT_GUIDE +- (id)initWithLayoutGuide:(MAS_LAYOUT_GUIDE *)layoutGuide{ + self = [super init]; + if (!self) return nil; + + self.layoutGuide = layoutGuide; + self.constraints = NSMutableArray.new; + + self.item = (id)layoutGuide; return self; } +#endif - (NSArray *)install { if (self.removeExisting) { @@ -57,7 +76,17 @@ - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(M } - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { - MASViewAttribute *viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute]; + MASViewAttribute *viewAttribute; +#ifdef MAS_LAYOUT_GUIDE + if (!self.view && self.layoutGuide) { + MAS_LAYOUT_GUIDE *layout = self.layoutGuide; + viewAttribute = [[MASViewAttribute alloc] initWithView:layout.owningView item:self.layoutGuide layoutAttribute:layoutAttribute]; + }else{ + viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute]; + } +#else + viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute]; +#endif MASViewConstraint *newConstraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:viewAttribute]; if ([constraint isKindOfClass:MASViewConstraint.class]) { //replace with composite constraint @@ -90,30 +119,30 @@ - (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs { NSMutableArray *attributes = [NSMutableArray array]; - if (attrs & MASAttributeLeft) [attributes addObject:self.view.mas_left]; - if (attrs & MASAttributeRight) [attributes addObject:self.view.mas_right]; - if (attrs & MASAttributeTop) [attributes addObject:self.view.mas_top]; - if (attrs & MASAttributeBottom) [attributes addObject:self.view.mas_bottom]; - if (attrs & MASAttributeLeading) [attributes addObject:self.view.mas_leading]; - if (attrs & MASAttributeTrailing) [attributes addObject:self.view.mas_trailing]; - if (attrs & MASAttributeWidth) [attributes addObject:self.view.mas_width]; - if (attrs & MASAttributeHeight) [attributes addObject:self.view.mas_height]; - if (attrs & MASAttributeCenterX) [attributes addObject:self.view.mas_centerX]; - if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY]; - if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline]; - if (attrs & MASAttributeFirstBaseline) [attributes addObject:self.view.mas_firstBaseline]; - if (attrs & MASAttributeLastBaseline) [attributes addObject:self.view.mas_lastBaseline]; + if (attrs & MASAttributeLeft) [attributes addObject:self.item.mas_left]; + if (attrs & MASAttributeRight) [attributes addObject:self.item.mas_right]; + if (attrs & MASAttributeTop) [attributes addObject:self.item.mas_top]; + if (attrs & MASAttributeBottom) [attributes addObject:self.item.mas_bottom]; + if (attrs & MASAttributeLeading) [attributes addObject:self.item.mas_leading]; + if (attrs & MASAttributeTrailing) [attributes addObject:self.item.mas_trailing]; + if (attrs & MASAttributeWidth) [attributes addObject:self.item.mas_width]; + if (attrs & MASAttributeHeight) [attributes addObject:self.item.mas_height]; + if (attrs & MASAttributeCenterX) [attributes addObject:self.item.mas_centerX]; + if (attrs & MASAttributeCenterY) [attributes addObject:self.item.mas_centerY]; + if (attrs & MASAttributeBaseline) [attributes addObject:self.item.mas_baseline]; + if (attrs & MASAttributeFirstBaseline) [attributes addObject:self.item.mas_firstBaseline]; + if (attrs & MASAttributeLastBaseline) [attributes addObject:self.item.mas_lastBaseline]; #if TARGET_OS_IPHONE || TARGET_OS_TV - if (attrs & MASAttributeLeftMargin) [attributes addObject:self.view.mas_leftMargin]; - if (attrs & MASAttributeRightMargin) [attributes addObject:self.view.mas_rightMargin]; - if (attrs & MASAttributeTopMargin) [attributes addObject:self.view.mas_topMargin]; - if (attrs & MASAttributeBottomMargin) [attributes addObject:self.view.mas_bottomMargin]; - if (attrs & MASAttributeLeadingMargin) [attributes addObject:self.view.mas_leadingMargin]; - if (attrs & MASAttributeTrailingMargin) [attributes addObject:self.view.mas_trailingMargin]; - if (attrs & MASAttributeCenterXWithinMargins) [attributes addObject:self.view.mas_centerXWithinMargins]; - if (attrs & MASAttributeCenterYWithinMargins) [attributes addObject:self.view.mas_centerYWithinMargins]; + if (attrs & MASAttributeLeftMargin) [attributes addObject:self.item.mas_leftMargin]; + if (attrs & MASAttributeRightMargin) [attributes addObject:self.item.mas_rightMargin]; + if (attrs & MASAttributeTopMargin) [attributes addObject:self.item.mas_topMargin]; + if (attrs & MASAttributeBottomMargin) [attributes addObject:self.item.mas_bottomMargin]; + if (attrs & MASAttributeLeadingMargin) [attributes addObject:self.item.mas_leadingMargin]; + if (attrs & MASAttributeTrailingMargin) [attributes addObject:self.item.mas_trailingMargin]; + if (attrs & MASAttributeCenterXWithinMargins) [attributes addObject:self.item.mas_centerXWithinMargins]; + if (attrs & MASAttributeCenterYWithinMargins) [attributes addObject:self.item.mas_centerYWithinMargins]; #endif diff --git a/Masonry/MASItemConstraintAdditions+Private.h b/Masonry/MASItemConstraintAdditions+Private.h new file mode 100644 index 00000000..93d0c79f --- /dev/null +++ b/Masonry/MASItemConstraintAdditions+Private.h @@ -0,0 +1,42 @@ +// +// MASConstraintMaker+Private.h +// Masonry iOS +// +// Created by zhiqiang_ye on 2020/8/25. +// Copyright © 2020 Jonas Budelmann. All rights reserved. +// + +#import "MASUtilities.h" + +NS_ASSUME_NONNULL_BEGIN +@class MASViewAttribute; +@protocol MASItemConstraintAdditions + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_left; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_top; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_right; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_width; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_height; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; +@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Masonry/MASUtilities.h b/Masonry/MASUtilities.h index 1dbfd938..f7080ee9 100644 --- a/Masonry/MASUtilities.h +++ b/Masonry/MASUtilities.h @@ -14,6 +14,9 @@ #import #define MAS_VIEW UIView + #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000 + #define MAS_LAYOUT_GUIDE UILayoutGuide + #endif #define MAS_VIEW_CONTROLLER UIViewController #define MASEdgeInsets UIEdgeInsets @@ -28,6 +31,9 @@ #import #define MAS_VIEW NSView + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 + #define MAS_LAYOUT_GUIDE NSLayoutGuide + #endif #define MASEdgeInsets NSEdgeInsets typedef NSLayoutPriority MASLayoutPriority; diff --git a/Masonry/MASViewConstraint.m b/Masonry/MASViewConstraint.m index af3f0b44..2d4f6be2 100644 --- a/Masonry/MASViewConstraint.m +++ b/Masonry/MASViewConstraint.m @@ -34,6 +34,31 @@ - (NSMutableSet *)mas_installedConstraints { @end +#ifdef MAS_LAYOUT_GUIDE + +@interface MAS_LAYOUT_GUIDE (MASConstraints) + +@property (nonatomic, readonly) NSMutableSet *mas_installedConstraints; + +@end + +@implementation MAS_LAYOUT_GUIDE (MASConstraints) + +static char kInstalledConstraintsKey; + +- (NSMutableSet *)mas_installedConstraints { + NSMutableSet *constraints = objc_getAssociatedObject(self, &kInstalledConstraintsKey); + if (!constraints) { + constraints = [NSMutableSet set]; + objc_setAssociatedObject(self, &kInstalledConstraintsKey, constraints, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return constraints; +} + +@end + +#endif + @interface MASViewConstraint () @@ -124,14 +149,21 @@ - (void)setSecondViewAttribute:(id)secondViewAttribute { [self setLayoutConstantWithValue:secondViewAttribute]; } else if ([secondViewAttribute isKindOfClass:MAS_VIEW.class]) { _secondViewAttribute = [[MASViewAttribute alloc] initWithView:secondViewAttribute layoutAttribute:self.firstViewAttribute.layoutAttribute]; - } else if ([secondViewAttribute isKindOfClass:MASViewAttribute.class]) { + } + #ifdef MAS_LAYOUT_GUIDE + else if ([secondViewAttribute isKindOfClass:MAS_LAYOUT_GUIDE.class]) { + id attr = secondViewAttribute; + _secondViewAttribute = [[MASViewAttribute alloc] initWithView:nil item:attr layoutAttribute:self.firstViewAttribute.layoutAttribute]; + } + #endif + else if ([secondViewAttribute isKindOfClass:MASViewAttribute.class]) { MASViewAttribute *attr = secondViewAttribute; if (attr.layoutAttribute == NSLayoutAttributeNotAnAttribute) { _secondViewAttribute = [[MASViewAttribute alloc] initWithView:attr.view item:attr.item layoutAttribute:self.firstViewAttribute.layoutAttribute];; } else { _secondViewAttribute = secondViewAttribute; } - } else { + }else { NSAssert(NO, @"attempting to add unsupported attribute: %@", secondViewAttribute); } } @@ -347,7 +379,16 @@ - (void)install { @"couldn't find a common superview for %@ and %@", self.firstViewAttribute.view, self.secondViewAttribute.view); self.installedView = closestCommonSuperview; - } else if (self.firstViewAttribute.isSizeAttribute) { + } + #ifdef MAS_LAYOUT_GUIDE + else if ([self.secondViewAttribute.item isKindOfClass:[MAS_LAYOUT_GUIDE class]]) { + MAS_VIEW *owningView = ((MAS_LAYOUT_GUIDE *)self.secondViewAttribute.item).owningView; + NSAssert(owningView, + @"couldn't find a common owningView for %@", self.secondViewAttribute.item); + self.installedView = owningView; + } + #endif + else if (self.firstViewAttribute.isSizeAttribute) { self.installedView = self.firstViewAttribute.view; } else { self.installedView = self.firstViewAttribute.view.superview; diff --git a/Masonry/Masonry.h b/Masonry/Masonry.h index d1bd579d..ed38793f 100644 --- a/Masonry/Masonry.h +++ b/Masonry/Masonry.h @@ -20,6 +20,7 @@ FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; #import "ViewController+MASAdditions.h" #import "NSArray+MASAdditions.h" #import "NSArray+MASShorthandAdditions.h" +#import "LayoutGuide+MASAdditions.h" #import "MASConstraint.h" #import "MASCompositeConstraint.h" #import "MASViewAttribute.h" diff --git a/Pods/Headers/Private/Masonry/LayoutGuide+MASAdditions.h b/Pods/Headers/Private/Masonry/LayoutGuide+MASAdditions.h new file mode 120000 index 00000000..915d77ab --- /dev/null +++ b/Pods/Headers/Private/Masonry/LayoutGuide+MASAdditions.h @@ -0,0 +1 @@ +../../../../Masonry/LayoutGuide+MASAdditions.h \ No newline at end of file diff --git a/Pods/Headers/Public/Masonry/LayoutGuide+MASAdditions.h b/Pods/Headers/Public/Masonry/LayoutGuide+MASAdditions.h new file mode 120000 index 00000000..915d77ab --- /dev/null +++ b/Pods/Headers/Public/Masonry/LayoutGuide+MASAdditions.h @@ -0,0 +1 @@ +../../../../Masonry/LayoutGuide+MASAdditions.h \ No newline at end of file diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index c8654693..84be29a2 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -17,6 +17,9 @@ 0E8E7C035F8969CF3DC93E5490A6158B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE147446A1225BA68EA82615B1436CC1 /* Foundation.framework */; }; 0F7BD72B0882E4D4DD27C3B914EC3857 /* MASConstraintMaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A28546AD6B1C73C384E28625120AED5 /* MASConstraintMaker.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0FE4C580D709657792E5661E74F171D5 /* EXPMatchers+match.m in Sources */ = {isa = PBXBuildFile; fileRef = 10F25824C22E66EAFBAA5C0F62629D84 /* EXPMatchers+match.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 106A948B24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 106A948924F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.m */; }; + 106A948C24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 106A948A24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1091037E24F78762007EEB46 /* MASItemConstraintAdditions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1091037D24F78762007EEB46 /* MASItemConstraintAdditions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 119C10C9E57E10B254B8B13A06D332F4 /* EXPMatchers+raise.h in Headers */ = {isa = PBXBuildFile; fileRef = 10F0627165FE862DA384F755B45FD6A7 /* EXPMatchers+raise.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11B98D7660EAD3B22A6F8DAFAC8E96F8 /* EXPMatchers+haveCountOf.h in Headers */ = {isa = PBXBuildFile; fileRef = 75992ED787187D30BE4B5F69BEF5EE30 /* EXPMatchers+haveCountOf.h */; settings = {ATTRIBUTES = (Public, ); }; }; 120A345233C900C50BAD6F3950FAB8FA /* NSValue+Expecta.h in Headers */ = {isa = PBXBuildFile; fileRef = 82F3CFD18ABD64DD8E88230EE43D854A /* NSValue+Expecta.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -154,8 +157,12 @@ 0A3DE5BA9F1F1BFDC50FA062018A4FF9 /* EXPMatcherHelpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = EXPMatcherHelpers.h; path = Expecta/Matchers/EXPMatcherHelpers.h; sourceTree = ""; }; 0AAF8809A7BBA8A694825848A7EF07D2 /* EXPMatchers+beTruthy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beTruthy.h"; path = "Expecta/Matchers/EXPMatchers+beTruthy.h"; sourceTree = ""; }; 0F2DF08BADAA0D595D88E9A5F2F4AE8F /* Pods-Masonry iOS Examples-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Masonry iOS Examples-dummy.m"; sourceTree = ""; }; + 106A948924F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "LayoutGuide+MASAdditions.m"; sourceTree = ""; }; + 106A948A24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LayoutGuide+MASAdditions.h"; sourceTree = ""; }; 10904D53FD27FC7E59BF92201687D517 /* EXPMatchers+beInTheRangeOf.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beInTheRangeOf.h"; path = "Expecta/Matchers/EXPMatchers+beInTheRangeOf.h"; sourceTree = ""; }; 10A477660D2D97AEF58A6795020511A9 /* libPods-Masonry iOS Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-Masonry iOS Tests.a"; path = "libPods-Masonry iOS Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1091037D24F78762007EEB46 /* MASItemConstraintAdditions+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MASItemConstraintAdditions+Private.h"; sourceTree = ""; }; + 10A477660D2D97AEF58A6795020511A9 /* libPods-Masonry iOS Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Masonry iOS Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 10F0627165FE862DA384F755B45FD6A7 /* EXPMatchers+raise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+raise.h"; path = "Expecta/Matchers/EXPMatchers+raise.h"; sourceTree = ""; }; 10F25824C22E66EAFBAA5C0F62629D84 /* EXPMatchers+match.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "EXPMatchers+match.m"; path = "Expecta/Matchers/EXPMatchers+match.m"; sourceTree = ""; }; 122F547802BB911D1B9F0D52C33B568D /* EXPMatchers+beLessThanOrEqualTo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "EXPMatchers+beLessThanOrEqualTo.h"; path = "Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.h"; sourceTree = ""; }; @@ -474,6 +481,9 @@ CFF7DF6CE7E3205ECC5D3904C3AC169D /* Masonry */ = { isa = PBXGroup; children = ( + 1091037D24F78762007EEB46 /* MASItemConstraintAdditions+Private.h */, + 106A948A24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.h */, + 106A948924F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.m */, E66C1687519434878576CA9CA479B868 /* MASCompositeConstraint.h */, 8524B32277BDB7E1A36FB5F3EB3BAC6B /* MASCompositeConstraint.m */, 9F34293A1C0AD9FD7013D79B910FE7E5 /* MASConstraint.h */, @@ -641,11 +651,13 @@ files = ( 76A58C6131A1264FDE3DADAEA0AC83F5 /* MASCompositeConstraint.h in Headers */, 3E2C9C19590011C8FE1F3966F4AF52D5 /* MASConstraint+Private.h in Headers */, + 1091037E24F78762007EEB46 /* MASItemConstraintAdditions+Private.h in Headers */, 9F196561D7369053FA6D9FD4374E85B9 /* MASConstraint.h in Headers */, 0F7BD72B0882E4D4DD27C3B914EC3857 /* MASConstraintMaker.h in Headers */, AEEF0434A83EF5F1949252A8409F71DD /* MASLayoutConstraint.h in Headers */, D69C7F6B7677C82AABBF7FE0057CE931 /* Masonry.h in Headers */, 28DD12DAF70F49B558112AA5E2809F19 /* MASUtilities.h in Headers */, + 106A948C24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.h in Headers */, 42FA711D0BA099127544F7A978075C9D /* MASViewAttribute.h in Headers */, 0D4B6D7C17953EF6C0BEFADA699DA6D2 /* MASViewConstraint.h in Headers */, 2C8FBF03AD0FD40587A84D2994D758B4 /* NSArray+MASAdditions.h in Headers */, @@ -760,6 +772,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; @@ -853,6 +866,7 @@ 2D814705CE041C701138BD9147CB21AA /* MASConstraint.m in Sources */, EBFA48D334098E6BAB801E6FB8F756C0 /* MASConstraintMaker.m in Sources */, 1AF47B7901796231A318934C2F0DDC04 /* MASLayoutConstraint.m in Sources */, + 106A948B24F4E75C00F7A2D5 /* LayoutGuide+MASAdditions.m in Sources */, B66BCA2DD1043A4356B5286F346F8049 /* Masonry-dummy.m in Sources */, A8A60B0CEECC7D7C9D8CA6B2DC811C64 /* MASViewAttribute.m in Sources */, 07B309A8727E5DBE05DB1F644F7B8D8A /* MASViewConstraint.m in Sources */,