Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【fixWarning】fix the link warning appeared in the new xcode build syst… #589

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Masonry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */; };
447354921B3A18B3004DACCB /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */; };
447354931B3A18B9004DACCB /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
8ABCACFA254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ABCACF9254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m */; };
8ABCACFB254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ABCACF9254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m */; };
8ABCACFF254FFDC300E68BB4 /* View+MASShorthandAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ABCACFE254FFDC300E68BB4 /* View+MASShorthandAdditions.m */; };
8ABCAD00254FFDC300E68BB4 /* View+MASShorthandAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ABCACFE254FFDC300E68BB4 /* View+MASShorthandAdditions.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -88,6 +92,8 @@
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>"; };
8ABCACF9254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+MASShorthandAdditions.m"; sourceTree = "<group>"; };
8ABCACFE254FFDC300E68BB4 /* View+MASShorthandAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "View+MASShorthandAdditions.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -133,11 +139,13 @@
3AED05EF1AD5A0470053CC65 /* View+MASAdditions.h */,
3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */,
3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */,
8ABCACFE254FFDC300E68BB4 /* View+MASShorthandAdditions.m */,
4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */,
4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */,
3AED05EA1AD5A0470053CC65 /* NSArray+MASAdditions.h */,
3AED05EB1AD5A0470053CC65 /* NSArray+MASAdditions.m */,
3AED05EC1AD5A0470053CC65 /* NSArray+MASShorthandAdditions.h */,
8ABCACF9254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m */,
3AED05DE1AD5A0470053CC65 /* MASConstraint.h */,
3AED05E01AD5A0470053CC65 /* MASConstraint+Private.h */,
3AED05DF1AD5A0470053CC65 /* MASConstraint.m */,
Expand Down Expand Up @@ -271,6 +279,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 3AED05AD1AD59FD40053CC65;
Expand Down Expand Up @@ -314,6 +323,8 @@
3AED05FF1AD5A0470053CC65 /* MASViewConstraint.m in Sources */,
3AED05F31AD5A0470053CC65 /* MASCompositeConstraint.m in Sources */,
3AED05F81AD5A0470053CC65 /* MASConstraintMaker.m in Sources */,
8ABCACFF254FFDC300E68BB4 /* View+MASShorthandAdditions.m in Sources */,
8ABCACFA254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m in Sources */,
3AED06041AD5A0470053CC65 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
3AED06061AD5A0470053CC65 /* View+MASAdditions.m in Sources */,
);
Expand All @@ -331,6 +342,8 @@
3AED060F1AD5A1400053CC65 /* MASCompositeConstraint.m in Sources */,
447354921B3A18B3004DACCB /* ViewController+MASAdditions.m in Sources */,
3AED06101AD5A1400053CC65 /* MASConstraintMaker.m in Sources */,
8ABCAD00254FFDC300E68BB4 /* View+MASShorthandAdditions.m in Sources */,
8ABCACFB254FFD5400E68BB4 /* NSArray+MASShorthandAdditions.m in Sources */,
3AED06111AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
3AED06121AD5A1400053CC65 /* View+MASAdditions.m in Sources */,
);
Expand Down
3 changes: 3 additions & 0 deletions Masonry/NSArray+MASAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import "NSArray+MASAdditions.h"
#import "View+MASAdditions.h"



@implementation NSArray (MASAdditions)

- (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block {
Expand Down Expand Up @@ -160,3 +162,4 @@ - (MAS_VIEW *)mas_commonSuperviewOfViews
}

@end

16 changes: 0 additions & 16 deletions Masonry/NSArray+MASShorthandAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,4 @@

@end

@implementation NSArray (MASShorthandAdditions)

- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
return [self mas_makeConstraints:block];
}

- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
return [self mas_updateConstraints:block];
}

- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
return [self mas_remakeConstraints:block];
}

@end

#endif
27 changes: 27 additions & 0 deletions Masonry/NSArray+MASShorthandAdditions.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// NSArray+MASShorthandAdditions.m
// Masonry
//
// Created by matt on 2020/11/2.
// Copyright © 2020 Jonas Budelmann. All rights reserved.
//

#import "NSArray+MASShorthandAdditions.h"

#ifdef MAS_SHORTHAND
@implementation NSArray (MASShorthandAdditions)

- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
return [self mas_makeConstraints:block];
}

- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
return [self mas_updateConstraints:block];
}

- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
return [self mas_remakeConstraints:block];
}

@end
#endif
69 changes: 0 additions & 69 deletions Masonry/View+MASShorthandAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,73 +66,4 @@

@end

#define MAS_ATTR_FORWARD(attr) \
- (MASViewAttribute *)attr { \
return [self mas_##attr]; \
}

#define MAS_ATTR_FORWARD_AVAILABLE(attr, available) \
- (MASViewAttribute *)attr available { \
return [self mas_##attr]; \
}

@implementation MAS_VIEW (MASShorthandAdditions)

MAS_ATTR_FORWARD(top);
MAS_ATTR_FORWARD(left);
MAS_ATTR_FORWARD(bottom);
MAS_ATTR_FORWARD(right);
MAS_ATTR_FORWARD(leading);
MAS_ATTR_FORWARD(trailing);
MAS_ATTR_FORWARD(width);
MAS_ATTR_FORWARD(height);
MAS_ATTR_FORWARD(centerX);
MAS_ATTR_FORWARD(centerY);
MAS_ATTR_FORWARD(baseline);

MAS_ATTR_FORWARD(firstBaseline);
MAS_ATTR_FORWARD(lastBaseline);

#if TARGET_OS_IPHONE || TARGET_OS_TV

MAS_ATTR_FORWARD(leftMargin);
MAS_ATTR_FORWARD(rightMargin);
MAS_ATTR_FORWARD(topMargin);
MAS_ATTR_FORWARD(bottomMargin);
MAS_ATTR_FORWARD(leadingMargin);
MAS_ATTR_FORWARD(trailingMargin);
MAS_ATTR_FORWARD(centerXWithinMargins);
MAS_ATTR_FORWARD(centerYWithinMargins);

MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideLeading, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideTrailing, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideLeft, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideRight, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideTop, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideBottom, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideWidth, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideHeight, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideCenterX, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideCenterY, NS_AVAILABLE_IOS(11.0));

#endif

- (MASViewAttribute *(^)(NSLayoutAttribute))attribute {
return [self mas_attribute];
}

- (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
return [self mas_makeConstraints:block];
}

- (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
return [self mas_updateConstraints:block];
}

- (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
return [self mas_remakeConstraints:block];
}

@end

#endif
81 changes: 81 additions & 0 deletions Masonry/View+MASShorthandAdditions.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
//
// View+MASShorthandAdditions.m
// Masonry
//
// Created by matt on 2020/11/2.
// Copyright © 2020 Jonas Budelmann. All rights reserved.
//

#import "View+MASShorthandAdditions.h"

#ifdef MAS_SHORTHAND

#define MAS_ATTR_FORWARD(attr) \
- (MASViewAttribute *)attr { \
return [self mas_##attr]; \
}

#define MAS_ATTR_FORWARD_AVAILABLE(attr, available) \
- (MASViewAttribute *)attr available { \
return [self mas_##attr]; \
}

@implementation MAS_VIEW (MASShorthandAdditions)

MAS_ATTR_FORWARD(top);
MAS_ATTR_FORWARD(left);
MAS_ATTR_FORWARD(bottom);
MAS_ATTR_FORWARD(right);
MAS_ATTR_FORWARD(leading);
MAS_ATTR_FORWARD(trailing);
MAS_ATTR_FORWARD(width);
MAS_ATTR_FORWARD(height);
MAS_ATTR_FORWARD(centerX);
MAS_ATTR_FORWARD(centerY);
MAS_ATTR_FORWARD(baseline);

MAS_ATTR_FORWARD(firstBaseline);
MAS_ATTR_FORWARD(lastBaseline);

#if TARGET_OS_IPHONE || TARGET_OS_TV

MAS_ATTR_FORWARD(leftMargin);
MAS_ATTR_FORWARD(rightMargin);
MAS_ATTR_FORWARD(topMargin);
MAS_ATTR_FORWARD(bottomMargin);
MAS_ATTR_FORWARD(leadingMargin);
MAS_ATTR_FORWARD(trailingMargin);
MAS_ATTR_FORWARD(centerXWithinMargins);
MAS_ATTR_FORWARD(centerYWithinMargins);

MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideLeading, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideTrailing, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideLeft, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideRight, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideTop, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideBottom, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideWidth, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideHeight, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideCenterX, NS_AVAILABLE_IOS(11.0));
MAS_ATTR_FORWARD_AVAILABLE(safeAreaLayoutGuideCenterY, NS_AVAILABLE_IOS(11.0));

#endif

- (MASViewAttribute *(^)(NSLayoutAttribute))attribute {
return [self mas_attribute];
}

- (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
return [self mas_makeConstraints:block];
}

- (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
return [self mas_updateConstraints:block];
}

- (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
return [self mas_remakeConstraints:block];
}

@end
#endif