Control

事件绑定

1
2
3
4
5
6
// 添加
- (void)ax_addEventHandler:(void (^)(__kindof UIControl *sender))handler forControlEvents:(UIControlEvents)controlEvents;
// 移除
- (void)ax_removeEventHandlersForControlEvents:(UIControlEvents)controlEvents;
// 是否响应事件
- (NSUInteger)ax_hasEventHandlersForControlEvents:(UIControlEvents)controlEvents;

Button

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
/**
添加一个任意事件

@param handler 处理事件的block
@param controlEvents 事件
*/
- (void)ax_addEventHandler:(void (^)(__kindof UIButton *sender))handler forControlEvents:(UIControlEvents)controlEvents;

/**
添加一个TouchDown事件

@param handler 处理事件的block
*/
- (void)ax_addTouchDownHandler:(void (^)(__kindof UIButton *sender))handler;

/**
添加一个TouchUpInside事件

@param handler 处理事件的block
*/
- (void)ax_addTouchUpInsideHandler:(void (^)(__kindof UIButton *sender))handler;

/**
添加一个TouchUpInside事件,并附加动画

@param handler 处理事件的block
@param scale 动画的缩放比例
@param duration 动画持续时间
*/
- (void)ax_addTouchUpInsideHandler:(nullable void (^)(__kindof UIButton *sender))handler animatedScale:(CGFloat)scale duration:(NSTimeInterval)duration;

Slider

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
/**
添加一个任意事件

@param handler 处理事件的block
@param controlEvents 事件
*/
- (void)ax_addEventHandler:(void (^)(__kindof UISlider *sender))handler forControlEvents:(UIControlEvents)controlEvents;

/**
添加一个TouchDown事件

@param handler 处理事件的block
*/
- (void)ax_addTouchDownHandler:(void (^)(__kindof UISlider *sender))handler;

/**
添加一个TouchDown事件,并附加动画

@param handler 处理事件的block
@param scale 动画的缩放比例
@param duration 动画持续时间
*/
- (void)ax_addTouchDownHandler:(nullable void (^)(__kindof UISlider *sender))handler animatedScale:(CGFloat)scale duration:(NSTimeInterval)duration;


/**
添加一个ValueChanged事件

@param handler 处理事件的block
*/
- (void)ax_addValueChangedHandler:(void (^)(__kindof UISlider *sender))handler;

/**
添加一个TouchUp事件

@param handler 处理事件的block
*/
- (void)ax_addTouchUpHandler:(void (^)(__kindof UISlider *sender))handler;

/**
添加一个TouchUp事件,并附加动画

@param handler 处理事件的block
@param scale 动画的缩放比例
@param duration 动画持续时间
*/
- (void)ax_addTouchUpHandler:(nullable void (^)(__kindof UISlider *sender))handler animatedScale:(CGFloat)scale duration:(NSTimeInterval)duration;

Switch

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
/**
添加一个任意事件

@param handler 处理事件的block
@param controlEvents 事件
*/
- (void)ax_addEventHandler:(void (^)(__kindof UISwitch *sender))handler forControlEvents:(UIControlEvents)controlEvents;

/**
添加一个TouchDown事件

@param handler 处理事件的block
*/
- (void)ax_addTouchDownHandler:(void (^)(__kindof UISwitch *sender))handler;

/**
添加一个ValueChanged事件

@param handler 处理事件的block
*/
- (void)ax_addValueChangedHandler:(void (^)(__kindof UISwitch *sender))handler;

/**
添加一个TouchUp事件

@param handler 处理事件的block
*/
- (void)ax_addTouchUpInsideHandler:(void (^)(__kindof UISwitch *sender))handler;

SegmentedControl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
添加一个任意事件

@param handler 处理事件的block
@param controlEvents 事件
*/
- (void)ax_addEventHandler:(void (^)(__kindof UISegmentedControl *sender))handler forControlEvents:(UIControlEvents)controlEvents;

/**
添加一个ValueChanged事件

@param handler 处理事件的block
*/
- (void)ax_addValueChangedHandler:(void (^)(__kindof UISegmentedControl *sender))handler;

TextField

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
/**
添加一个任意事件

@param handler 处理事件的block
@param controlEvents 事件
*/
- (void)ax_addEventHandler:(void (^)(__kindof UITextField *sender))handler forControlEvents:(UIControlEvents)controlEvents;

/**
添加一个EditingBegin事件

@param handler 处理事件的block
*/
- (void)ax_addEditingBeginHandler:(void (^)(__kindof UITextField *sender))handler;

/**
添加一个EditingBegin事件,并附加动画

@param handler 处理事件的block
@param scale 动画的缩放比例
@param duration 动画持续时间
*/
- (void)ax_addEditingBeginHandler:(nullable void (^)(__kindof UITextField *sender))handler animatedScale:(CGFloat)scale duration:(NSTimeInterval)duration;

/**
添加一个EditingChanged事件

@param handler 处理事件的block
*/
- (void)ax_addEditingChangedHandler:(void (^)(__kindof UITextField *sender))handler;

/**
添加一个EditingEndOnExit事件

@param handler 处理事件的block
*/
- (void)ax_addEditingEndOnExitHandler:(void (^)(__kindof UITextField *sender))handler;

/**
添加一个EditingEnd事件

@param handler 处理事件的block
*/
- (void)ax_addEditingEndHandler:(void (^)(__kindof UITextField *sender))handler;

/**
添加一个EditingEnd事件,并附加动画

@param handler 处理事件的block
@param scale 动画的缩放比例
@param duration 动画持续时间
*/
- (void)ax_addEditingEndHandler:(nullable void (^)(__kindof UITextField *sender))handler animatedScale:(CGFloat)scale duration:(NSTimeInterval)duration;

弹出键盘时视图上移

1
2
3
4
5
6
/**
当键盘弹出的时候调整某个view的frame

@param view 需要调整的view
*/
- (void)ax_adjustViewFrameWithKeyboard:(UIView *)view;



评论