我想以编程方式在屏幕上的某个点触发触摸事件。你知道怎么做吗?
例如,我想点击一个 UIView,然后它应该检查某些条件是否正确,如果不正确,那么我将调用 setUserInteractionEnabled 为 NO,然后在同一点触发另一个事件,这样该点穿过视图并到达下一个。然后将重新启用用户交互。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
checking conditions if conditions are right.
{[self setUserInteractionEnabled: NO];
//fire another touch event at the same point so it goes through this view
[self setUserInteractionEnabled: YES];
}