我有一个 UIView 子类,我在其中覆盖了多点触控处理方法。我的问题是,如果我在该视图上使用给定的触摸执行计算,它会破坏模型视图控制器设计模式吗?计算后,我必须隐藏视图、打印结果并更新我的核心数据模型。我对此感到困惑。
编辑:
一些代码。
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
// getting all the touches in the given gesture sequence
NSSet *allTouches = [event allTouches];
// checking taps count
if ([allTouches count] == 3)
{
// here I print the results and do the calculations
[self validateGestureSequenceWithTouches:allTouches];
}
// cleaning the view
NSArray *subviews = [self subviews];
for (UIView *view in subviews) {
if (![view isKindOfClass:[UINavigationBar class]])
[view removeFromSuperview];
}
}