i'm trying to make a connect four iphone app. I have made my own custom UIView class, which is where the game is played. However, I am trying to use the touchesMoved, touchesEnded, etc. methods to retrieve data based on where the user clicked (so i know which column they are trying to put a piece into). How开发者_JS百科 can i get this information from the viewController class to my UIview class?
I would just use - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
and potentially override - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
to ignore touches in views that I may have overlaid. It does depend on your view hierarchy really.
精彩评论