-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJCFrame.h
More file actions
76 lines (59 loc) · 1.62 KB
/
JCFrame.h
File metadata and controls
76 lines (59 loc) · 1.62 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// JCFrame.h
// JCFrameLayout
//
// Created by abc on 17/3/27.
// Copyright © 2017年 jackcat. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "JCFrameLayoutConst.h"
#import "JCFrameUtilities.h"
#import "JCFrameAttribute.h"
@class JCFrame;
@protocol JCFrameDelegate <NSObject>
- (JCFrame*)jcFrame:(JCFrame*)jcFrame createFrameWithframeType:(JCFrameType)frameType;
@end
@interface JCFrame : NSObject
@property (nonatomic,weak) id<JCFrameDelegate> delegate;
/**
* 当前属性的值
**/
@property (nonatomic,strong,readonly) id value;
/**
* 当前属性的偏移值,只在相对布局的时候生效
**/
@property (nonatomic,strong,readonly) id offset;
/**
* 当前属性的倍数,只在相对布局的时候生效
**/
@property (nonatomic,assign,readonly) CGFloat multiplier;
/**
* 是否生效,便于调试,没其他用处
**/
@property (nonatomic,assign) BOOL actived;
/**
* 是否有相对属性
**/
@property (nonatomic,assign,readonly) BOOL hasRelateAttr;
/**
* 布局属性
**/
@property (nonatomic,strong,strong) JCFrameAttribute *frameAttr;
- (instancetype)initWithFrameAttribute:(JCFrameAttribute*)frameAttribute;
- (JCFrame*)left;
- (JCFrame*)right;
- (JCFrame*)top;
- (JCFrame*)bottom;
- (JCFrame*)width;
- (JCFrame*)height;
- (JCFrame*)centerX;
- (JCFrame*)centerY;
- (JCFrame*)center;
- (JCFrame*)size;
#define jc_equalTo(...) equalTo(JCBoxValue((__VA_ARGS__)))
#define jc_offset(...) jc_offset(JCBoxValue((__VA_ARGS__)))
- (JCFrame*(^)(id))jc_equalTo;
- (JCFrame*(^)(id))equalTo;
- (JCFrame*(^)(CGFloat))multipliedBy;
- (JCFrame*(^)(id))jc_offset;
@end