123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- #import "MASConstraint.h"
- #import "MASUtilities.h"
- typedef NS_OPTIONS(NSInteger, MASAttribute) {
- MASAttributeLeft = 1 << NSLayoutAttributeLeft,
- MASAttributeRight = 1 << NSLayoutAttributeRight,
- MASAttributeTop = 1 << NSLayoutAttributeTop,
- MASAttributeBottom = 1 << NSLayoutAttributeBottom,
- MASAttributeLeading = 1 << NSLayoutAttributeLeading,
- MASAttributeTrailing = 1 << NSLayoutAttributeTrailing,
- MASAttributeWidth = 1 << NSLayoutAttributeWidth,
- MASAttributeHeight = 1 << NSLayoutAttributeHeight,
- MASAttributeCenterX = 1 << NSLayoutAttributeCenterX,
- MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
- MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,
-
- #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
-
- MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline,
- MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline,
-
- #endif
-
- #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
-
- MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
- MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
- MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin,
- MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin,
- MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin,
- MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin,
- MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins,
- MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins,
- #endif
-
- };
- @interface MASConstraintMaker : NSObject
- @property (nonatomic, strong, readonly) MASConstraint *left;
- @property (nonatomic, strong, readonly) MASConstraint *top;
- @property (nonatomic, strong, readonly) MASConstraint *right;
- @property (nonatomic, strong, readonly) MASConstraint *bottom;
- @property (nonatomic, strong, readonly) MASConstraint *leading;
- @property (nonatomic, strong, readonly) MASConstraint *trailing;
- @property (nonatomic, strong, readonly) MASConstraint *width;
- @property (nonatomic, strong, readonly) MASConstraint *height;
- @property (nonatomic, strong, readonly) MASConstraint *centerX;
- @property (nonatomic, strong, readonly) MASConstraint *centerY;
- @property (nonatomic, strong, readonly) MASConstraint *baseline;
- #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
- @property (nonatomic, strong, readonly) MASConstraint *firstBaseline;
- @property (nonatomic, strong, readonly) MASConstraint *lastBaseline;
- #endif
- #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
- @property (nonatomic, strong, readonly) MASConstraint *leftMargin;
- @property (nonatomic, strong, readonly) MASConstraint *rightMargin;
- @property (nonatomic, strong, readonly) MASConstraint *topMargin;
- @property (nonatomic, strong, readonly) MASConstraint *bottomMargin;
- @property (nonatomic, strong, readonly) MASConstraint *leadingMargin;
- @property (nonatomic, strong, readonly) MASConstraint *trailingMargin;
- @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins;
- @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins;
- #endif
- @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs);
- @property (nonatomic, strong, readonly) MASConstraint *edges;
- @property (nonatomic, strong, readonly) MASConstraint *size;
- @property (nonatomic, strong, readonly) MASConstraint *center;
- @property (nonatomic, assign) BOOL updateExisting;
- @property (nonatomic, assign) BOOL removeExisting;
- - (id)initWithView:(MAS_VIEW *)view;
- - (NSArray *)install;
- - (MASConstraint * (^)(dispatch_block_t))group;
- @end
|