iPhoneのテーブルビューで通常のタップを認識する
-
08-07-2019 - |
質問
カスタムセルを含むテーブルビューがあり、そのセルでスワイプが認識されます。それはうまく機能しますが、Table Viewが正常に動作することを望みます。テーブルビューのどこをタップしても、セルを選択してアクションtableView:didSelectRowAtIndexPath:
を実行したいヒントやアイデアはありますか
ありがとう。
解決
UITableViewセルサブクラスでさまざまなUIResponderメソッドを実装していると仮定します。スタックの残りの部分でイベントの処理を続けたい場合は、単にそれらを渡すことができます:
- (void) touchEnded:(UITouch *)touch withEvent:(UIEvent *)event {
//do something with touch
//...
//pass the event to super which cause it to continue along the chain as
//though you didn't do anything special with it
[super touchEnded:touch withEvent:event];
}
所属していません StackOverflow