-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathRFToolbarButton.h
45 lines (38 loc) · 1.06 KB
/
RFToolbarButton.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
41
42
43
44
45
//
// RFToolbarButton.h
//
// Created by Rudd Fawcett on 12/3/13.
// Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
* The block used for each button.
*/
typedef void (^eventHandlerBlock)();
@interface RFToolbarButton : UIButton
/**
* Creates a new RFToolbarButton.
*
* @param title The string to show on the button.
*
* @return A new button.
*/
+ (instancetype)buttonWithTitle:(NSString *)title;
/**
* Creates a new RFToolbarButton.
*
* @param title The string to show on the button.
* @param eventHandler The event handler block.
* @param controlEvent The type of event.
*
* @return A new button.
*/
+ (instancetype)buttonWithTitle:(NSString *)title andEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent;
/**
* Adds the event handler for the button.
*
* @param eventHandler The event handler block.
* @param controlEvent The type of event.
*/
- (void)addEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent;
@end