/BlocksKit/UIControl+BlocksKit.h
C++ Header | 44 lines | 6 code | 7 blank | 31 comment | 0 complexity | f896dc3ac1b08a841d54ce98be51319f MD5 | raw file
1// 2// UIControl+BlocksKit.h 3// %PROJECT 4// 5 6#import "BKGlobals.h" 7 8/** Block control event handling for UIControl. 9 10 Includes code by the following: 11 12 - Kevin O'Neill. <https://github.com/kevinoneill>. 2011. BSD. 13 - Zach Waldowski. <https://github.com/zwaldowski>. 2011. MIT. 14 15 @warning UIControl is only available on iOS or in a Mac app using Chameleon. 16 */ 17@interface UIControl (BlocksKit) 18 19///----------------------------------- 20/// @name Block event handling 21///----------------------------------- 22 23/** Adds a block for a particular event to an internal dispatch table. 24 25 @param handler A block representing an action message, with an argument for the sender. 26 @param controlEvents A bitmask specifying the control events for which the action message is sent. 27 @see removeEventHandlersForControlEvents: 28 */ 29- (void)addEventHandler:(BKSenderBlock)handler forControlEvents:(UIControlEvents)controlEvents; 30 31/** Removes all blocks for a particular event combination. 32 @param controlEvents A bitmask specifying the control events for which the block will be removed. 33 @see addEventHandler:forControlEvents: 34 */ 35- (void)removeEventHandlersForControlEvents:(UIControlEvents)controlEvents; 36 37/** Checks to see if the control has any blocks for a particular event combination. 38 @param controlEvents A bitmask specifying the control events for which to check for blocks. 39 @see addEventHandler:forControlEvents: 40 @return Returns YES if there are blocks for these control events, NO otherwise. 41 */ 42- (BOOL)hasEventHandlersForControlEvents:(UIControlEvents)controlEvents; 43 44@end