Ignore touches to UIView subclass, but not to its subviews
Note: I’ve moved all future technical/programming posts out of this blog and over to objectivesea.tumblr.com. Follow that one if you’re going to follow me for technical junk.
If you want a UIView subclass to ignore touch events, just set its userInteractionEnabled property to NO. But that will block touches to all its subviews. To ignore touches in a UIView subclass, but not its subviews, just work a little hitTest magic:
-(id)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
id hitView = [super hitTest:point withEvent:event];
if (hitView == self) return nil;
else return hitView;
}
I usually have one header file just for keys I use throughout the project.
Create a new property list, and enter default values for all your settings. Make sure the keys match the ones you #define-d. Also pay attention to the types.