-
Notifications
You must be signed in to change notification settings - Fork 193
/
BONTextAlignmentConstraint.h
40 lines (31 loc) · 1.34 KB
/
BONTextAlignmentConstraint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// BONTextAlignmentConstraint.h
// BonMot
//
// Created by Zev Eisenberg on 5/2/15.
//
//
@import UIKit;
#import "BONCompatibility.h"
typedef NS_ENUM(NSUInteger, BONConstraintAttribute) {
BONConstraintAttributeUnspecified = 0,
BONConstraintAttributeTop,
BONConstraintAttributeCapHeight,
BONConstraintAttributeXHeight,
BONConstraintAttributeFirstBaseline,
BONConstraintAttributeLastBaseline,
BONConstraintAttributeBottom,
};
NSString *BONCNonnull stringFromBONConstraintAttribute(BONConstraintAttribute attribute);
BONConstraintAttribute BONConstraintAttributeFromString(NSString *BONCNonnull string);
@interface BONTextAlignmentConstraint : NSLayoutConstraint
@property (nonatomic) BONConstraintAttribute firstItemBONAttribute;
@property (nonatomic) BONConstraintAttribute secondItemBONAttribute;
@property (copy, nonatomic, BONNullable) IBInspectable NSString *firstAlignment;
@property (copy, nonatomic, BONNullable) IBInspectable NSString *secondAlignment;
+ (BONNonnull instancetype)constraintWithItem:(BONNonnull id)view1
attribute:(BONConstraintAttribute)attr1
relatedBy:(NSLayoutRelation)relation
toItem:(BONNonnull id)view2
attribute:(BONConstraintAttribute)attr2;
@end