I think the best think to do this is to subclass UIView. In your subclass header:
//MyCircleView.h
@interface MyCircleView : UIView
@end
In your implementation, use touchesDidBegin to toggle the background color when touches begin:
//MyCircleView.m
#import "MyCircleView.h
@interface MyCircleView()
@property (nonatomic) BOOL isSelected;
@end
@implementation MyCircleView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
_isSelected = !_isSelected;
//change background color
self.backgroundColor = (_isSelected) ? [UIColor grayColor] : otherColor;
}
@end
If you want a shadow overlay, just change the code in the touchesBegan to toggle a UIView that can be added as a subview to the circle view:
//MyCircleView.m
#import "MyCircleView.h
@interface MyCircleView()
@property (nonatomic, strong) UIView *overlay;
@property (nonatomic) BOOL isSelected;
@end
@implementation MyCircleView
- (void)toggleOverlay {
_isSelected = !_isSelected;
//if overlay doesn't exist, create it
if (!_overlay) {
_overlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
_overlay.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f]; //change overlay background alpha if you want it more/less transparent
[_overlay setHidden:YES];
[self addSubview:_overlay];
}
//show/hide overlay depending on selection
[_overlay setHidden:!_isSelected];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self toggleOverlay];
}
@end