我有一個實現則hitTest一個自定義的UIView:withEvent:方法則hitTest:withEvent:方法的UIEvent allTouches是空
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
.... some code ....
int x = 0;
x= [[event allTouches] count];
return [super hitTest:point withEvent:event];
}
的問題是,X始終是0。我必須執行其他API或配置的UIView啓動得到觸動?
我只需要它來區分觸摸開始/移動和結束。
由於 賈米爾
什麼顯示'NSLog(@「Event:%@」,事件);'? –
事件:時間戳:0觸摸:{( )} 事件:時間戳:0觸摸:{( )} 事件:時間戳:248999點的觸摸:{ ( )} –
Jamil
@PhillipMills hitTest被調用三次,並且日誌高於 – Jamil