I guess the goal was to make a short cut class of UIControl with factoring away the most common touch event UIControlEventTouchUpInside:
@interface MiniButton : UIControl
-(void)addTarget:(id)target action:(SEL)action;
-(void)removeTarget:(id)target action:(SEL)action;
-(void)_callAllTargets;
@end
@implementation MiniButton
-(void)addTarget:(id)target action:(SEL)action
{
[self addTarget:target action:action forControlEvents: UIControlEventTouchUpInside];
}
-(void)removeTarget:(id)target action:(SEL)action{
[self removeTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
}
-(void) _callAllTargets
{
[self sendActionsForControlEvents:UIControlEventTouchUpInside];
}
@end
Another option could have been, that he wanted you to extend UIButton. But as UIButton is a so-called class cluster (comparable with a factory), it should not be extended by sub-classing but can be extended by creating a category on UIControl, the parent class of UIButton. Now any instance of any button is extended, no matter what subclass is returned.
I think he wanted you to show some knowledge about the fact, that actually UIButton and it real classes are just a small layer on top of UIControl. UIButton has only the reposibility of showing the button's label, image,… . all other things reside in UIControl and it ancestors.
#define _CallAllTargetssomeplace?