If you already have a subclass override these methods:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
Then you can recognize when your UIView
is touched an draw accordingly.
You could draw a border to view's layer or you could draw a rectangular path in the drawRect:(NSRect *)
of your subclass.
For example:
#import <QuartzCore/QuartzCore.h>
view.layer.borderColor = [UIColor greenColor].CGColor;
view.layer.borderWidth = 5.0f;