Skip to content

Commit

Permalink
TVOS Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Hahn committed Dec 15, 2015
1 parent 75323c4 commit 86ae830
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Masonry/MASCompositeConstraint.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAtt

#pragma mark - Animator proxy

#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)

- (MASConstraint *)animator {
for (MASConstraint *constraint in self.childConstraints) {
Expand Down
4 changes: 2 additions & 2 deletions Masonry/MASConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
- (MASConstraint *)centerY;
- (MASConstraint *)baseline;

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

- (MASConstraint *)leftMargin;
- (MASConstraint *)rightMargin;
Expand Down Expand Up @@ -178,7 +178,7 @@

// NSLayoutConstraint Installation support

#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
/**
* Whether or not to go through the animator proxy when modifying the constraint
*/
Expand Down
4 changes: 2 additions & 2 deletions Masonry/MASConstraint.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ - (MASConstraint *)baseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
}

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

- (MASConstraint *)leftMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
Expand Down Expand Up @@ -264,7 +264,7 @@ - (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented

- (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); }

#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)

- (MASConstraint *)animator { MASMethodNotImplemented(); }

Expand Down
4 changes: 2 additions & 2 deletions Masonry/MASConstraintMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef NS_OPTIONS(NSInteger, MASAttribute) {
MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
Expand Down Expand Up @@ -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_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

@property (nonatomic, strong, readonly) MASConstraint *leftMargin;
@property (nonatomic, strong, readonly) MASConstraint *rightMargin;
Expand Down
6 changes: 3 additions & 3 deletions Masonry/MASConstraintMaker.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs {
__unused MASAttribute anyAttribute = (MASAttributeLeft | MASAttributeRight | MASAttributeTop | MASAttributeBottom | MASAttributeLeading
| MASAttributeTrailing | MASAttributeWidth | MASAttributeHeight | MASAttributeCenterX
| MASAttributeCenterY | MASAttributeBaseline
#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV
| MASAttributeLeftMargin | MASAttributeRightMargin | MASAttributeTopMargin | MASAttributeBottomMargin
| MASAttributeLeadingMargin | MASAttributeTrailingMargin | MASAttributeCenterXWithinMargins
| MASAttributeCenterYWithinMargins
Expand All @@ -101,7 +101,7 @@ - (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs {
if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY];
if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline];

#if TARGET_OS_IPHONE_AND_OS_TV
#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];
Expand Down Expand Up @@ -182,7 +182,7 @@ - (MASConstraint *)baseline {
};
}

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

- (MASConstraint *)leftMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
Expand Down
2 changes: 0 additions & 2 deletions Masonry/MASUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#if TARGET_OS_IPHONE || TARGET_OS_TV

#define TARGET_OS_IPHONE_AND_OS_TV 1

#import <UIKit/UIKit.h>
#define MAS_VIEW UIView
#define MAS_VIEW_CONTROLLER UIViewController
Expand Down
4 changes: 2 additions & 2 deletions Masonry/MASViewConstraint.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view {
- (void)setLayoutConstant:(CGFloat)layoutConstant {
_layoutConstant = layoutConstant;

#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
if (self.useAnimator) {
[self.layoutConstraint.animator setConstant:layoutConstant];
} else {
Expand Down Expand Up @@ -211,7 +211,7 @@ - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAtt

#pragma mark - Animator proxy

#if TARGET_OS_MAC && !TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)

- (MASConstraint *)animator {
self.useAnimator = YES;
Expand Down
4 changes: 2 additions & 2 deletions Masonry/NSLayoutConstraint+MASDebugAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ + (NSDictionary *)layoutAttributeDescriptionsByValue {
@(NSLayoutAttributeCenterY) : @"centerY",
@(NSLayoutAttributeBaseline) : @"baseline",

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV
@(NSLayoutAttributeLeftMargin) : @"leftMargin",
@(NSLayoutAttributeRightMargin) : @"rightMargin",
@(NSLayoutAttributeTopMargin) : @"topMargin",
Expand All @@ -66,7 +66,7 @@ + (NSDictionary *)layoutPriorityDescriptionsByValue {
static dispatch_once_t once;
static NSDictionary *descriptionMap;
dispatch_once(&once, ^{
#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV
descriptionMap = @{
@(MASLayoutPriorityDefaultHigh) : @"high",
@(MASLayoutPriorityDefaultLow) : @"low",
Expand Down
2 changes: 1 addition & 1 deletion Masonry/View+MASAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr);

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin;
@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin;
Expand Down
2 changes: 1 addition & 1 deletion Masonry/View+MASAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ - (MASViewAttribute *)mas_baseline {
};
}

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

- (MASViewAttribute *)mas_leftMargin {
return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin];
Expand Down
4 changes: 2 additions & 2 deletions Masonry/View+MASShorthandAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@property (nonatomic, strong, readonly) MASViewAttribute *baseline;
@property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr);

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

@property (nonatomic, strong, readonly) MASViewAttribute *leftMargin;
@property (nonatomic, strong, readonly) MASViewAttribute *rightMargin;
Expand Down Expand Up @@ -67,7 +67,7 @@ MAS_ATTR_FORWARD(centerX);
MAS_ATTR_FORWARD(centerY);
MAS_ATTR_FORWARD(baseline);

#if TARGET_OS_IPHONE_AND_OS_TV
#if TARGET_OS_IPHONE || TARGET_OS_TV

MAS_ATTR_FORWARD(leftMargin);
MAS_ATTR_FORWARD(rightMargin);
Expand Down

0 comments on commit 86ae830

Please sign in to comment.