Files
keyboard/Pods/LookinServer/Src/Main/Shared/LookinAutoLayoutConstraint.h
2025-10-28 10:18:10 +08:00

52 lines
1.9 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifdef SHOULD_COMPILE_LOOKIN_SERVER
//
// LookinAutoLayoutConstraint.h
// Lookin
//
// Created by Li Kai on 2019/9/28.
// https://lookin.work
//
#import "LookinDefines.h"
@class LookinObject;
typedef NS_ENUM(NSInteger, LookinConstraintItemType) {
LookinConstraintItemTypeUnknown,
LookinConstraintItemTypeNil,
LookinConstraintItemTypeView,
LookinConstraintItemTypeSelf,
LookinConstraintItemTypeSuper,
LookinConstraintItemTypeLayoutGuide
};
@interface LookinAutoLayoutConstraint : NSObject <NSSecureCoding>
#if TARGET_OS_IPHONE
+ (instancetype)instanceFromNSConstraint:(NSLayoutConstraint *)constraint isEffective:(BOOL)isEffective firstItemType:(LookinConstraintItemType)firstItemType secondItemType:(LookinConstraintItemType)secondItemType;
#endif
@property(nonatomic, assign) BOOL effective;
@property(nonatomic, assign) BOOL active;
@property(nonatomic, assign) BOOL shouldBeArchived;
@property(nonatomic, strong) LookinObject *firstItem;
@property(nonatomic, assign) LookinConstraintItemType firstItemType;
/// iOS 里的 NSLayoutAttribute注意 iOS 和 macOS 虽然都有 NSLayoutAttribute 但是 value 非常不同,因此这里使用 NSInteger 避免混淆
@property(nonatomic, assign) NSInteger firstAttribute;
@property(nonatomic, assign) NSLayoutRelation relation;
@property(nonatomic, strong) LookinObject *secondItem;
@property(nonatomic, assign) LookinConstraintItemType secondItemType;
/// iOS 里的 NSLayoutAttribute注意 iOS 和 macOS 虽然都有 NSLayoutAttribute 但是 value 非常不同,因此这里使用 NSInteger 避免混淆
@property(nonatomic, assign) NSInteger secondAttribute;
@property(nonatomic, assign) CGFloat multiplier;
@property(nonatomic, assign) CGFloat constant;
@property(nonatomic, assign) CGFloat priority;
@property(nonatomic, copy) NSString *identifier;
@end
#endif /* SHOULD_COMPILE_LOOKIN_SERVER */