Authored by Mario Hahn

Added TVOS

Pod::Spec.new do |s|
s.name = 'Masonry'
s.version = '0.6.3'
s.version = '0.6.4'
s.license = 'MIT'
s.summary = 'Harness the power of Auto Layout NSLayoutConstraints with a simplified, chainable and expressive syntax.'
s.homepage = 'https://github.com/cloudkite/Masonry'
... ... @@ -23,5 +23,6 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '6.0' # minimum SDK with autolayout
s.osx.deployment_target = '10.7' # minimum SDK with autolayout
s.tvos.deployment_target = '9.0' # minimum SDK with autolayout
s.requires_arc = true
end
... ...
... ... @@ -97,7 +97,7 @@
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
- (MASConstraint *)animator {
for (MASConstraint *constraint in self.childConstraints) {
... ...
... ... @@ -127,7 +127,7 @@
- (MASConstraint *)centerY;
- (MASConstraint *)baseline;
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
- (MASConstraint *)leftMargin;
- (MASConstraint *)rightMargin;
... ... @@ -178,7 +178,7 @@
// NSLayoutConstraint Installation support
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
/**
* Whether or not to go through the animator proxy when modifying the constraint
*/
... ...
... ... @@ -208,7 +208,7 @@
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
}
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
- (MASConstraint *)leftMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
... ... @@ -264,7 +264,7 @@
- (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); }
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
- (MASConstraint *)animator { MASMethodNotImplemented(); }
... ...
... ... @@ -22,7 +22,7 @@ typedef NS_OPTIONS(NSInteger, MASAttribute) {
MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
... ... @@ -60,7 +60,7 @@ typedef NS_OPTIONS(NSInteger, MASAttribute) {
@property (nonatomic, strong, readonly) MASConstraint *centerY;
@property (nonatomic, strong, readonly) MASConstraint *baseline;
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
@property (nonatomic, strong, readonly) MASConstraint *leftMargin;
@property (nonatomic, strong, readonly) MASConstraint *rightMargin;
... ...
... ... @@ -78,7 +78,7 @@
__unused MASAttribute anyAttribute = (MASAttributeLeft | MASAttributeRight | MASAttributeTop | MASAttributeBottom | MASAttributeLeading
| MASAttributeTrailing | MASAttributeWidth | MASAttributeHeight | MASAttributeCenterX
| MASAttributeCenterY | MASAttributeBaseline
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
| MASAttributeLeftMargin | MASAttributeRightMargin | MASAttributeTopMargin | MASAttributeBottomMargin
| MASAttributeLeadingMargin | MASAttributeTrailingMargin | MASAttributeCenterXWithinMargins
| MASAttributeCenterYWithinMargins
... ... @@ -101,7 +101,7 @@
if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY];
if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline];
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
if (attrs & MASAttributeLeftMargin) [attributes addObject:self.view.mas_leftMargin];
if (attrs & MASAttributeRightMargin) [attributes addObject:self.view.mas_rightMargin];
... ... @@ -182,7 +182,7 @@
};
}
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
- (MASConstraint *)leftMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
... ...
... ... @@ -8,7 +8,11 @@
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE || TARGET_OS_TV
#define TARGET_OS_IPHONE_AND_OS_TV 1
#import <UIKit/UIKit.h>
#define MAS_VIEW UIView
... ...
... ... @@ -86,7 +86,7 @@ static char kInstalledConstraintsKey;
- (void)setLayoutConstant:(CGFloat)layoutConstant {
_layoutConstant = layoutConstant;
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
if (self.useAnimator) {
[self.layoutConstraint.animator setConstant:layoutConstant];
} else {
... ... @@ -211,7 +211,7 @@ static char kInstalledConstraintsKey;
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
- (MASConstraint *)animator {
self.useAnimator = YES;
... ...
... ... @@ -44,7 +44,7 @@
@(NSLayoutAttributeCenterY) : @"centerY",
@(NSLayoutAttributeBaseline) : @"baseline",
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
@(NSLayoutAttributeLeftMargin) : @"leftMargin",
@(NSLayoutAttributeRightMargin) : @"rightMargin",
@(NSLayoutAttributeTopMargin) : @"topMargin",
... ... @@ -66,7 +66,7 @@
static dispatch_once_t once;
static NSDictionary *descriptionMap;
dispatch_once(&once, ^{
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
descriptionMap = @{
@(MASLayoutPriorityDefaultHigh) : @"high",
@(MASLayoutPriorityDefaultLow) : @"low",
... ...
... ... @@ -32,7 +32,7 @@
@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr);
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin;
@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin;
... ...
... ... @@ -87,7 +87,7 @@
};
}
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
- (MASViewAttribute *)mas_leftMargin {
return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin];
... ...
... ... @@ -29,7 +29,7 @@
@property (nonatomic, strong, readonly) MASViewAttribute *baseline;
@property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr);
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
@property (nonatomic, strong, readonly) MASViewAttribute *leftMargin;
@property (nonatomic, strong, readonly) MASViewAttribute *rightMargin;
... ... @@ -67,7 +67,7 @@ MAS_ATTR_FORWARD(centerX);
MAS_ATTR_FORWARD(centerY);
MAS_ATTR_FORWARD(baseline);
#if TARGET_OS_IPHONE
#if TARGET_OS_IPHONE_AND_OS_TV
MAS_ATTR_FORWARD(leftMargin);
MAS_ATTR_FORWARD(rightMargin);
... ...