[memo] Objective-Cのタッチイベント
Categorie:{ Objective-C } Tag:{Apple, iPad, iPhone, Objectice-C} Comments:{ No Comments }
Posted:{ 2010.08.01 06:24:11 }
Posted:{ 2010.08.01 06:24:11 }
なんとなくカジッてるObjective-Cのタッチイベント、4種類。
よく使うのでメモ。(シングルタッチ)
タッチの座標をトレースするよ。
この辺は丸覚えなきゃね!
//------------------------------------------------------------ // // タッチ開始 // -(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event{ CGPoint pos=[[touches anyObject] locationInView:self]; NSLog(@"[BEGAN](x = %f , y = %f)",pos.x,pos.y); } //------------------------------------------------------------ // // タッチムーブ // -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ //現在のタッチポイント CGPoint pos =[ [touches anyObject] locationInView:self]; NSLog(@"[MOVE](x = %f , y = %f)",pos.x,pos.y); } //------------------------------------------------------------ // // タッチ終了 // -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"[END]"); } //------------------------------------------------------------ // // タッチキャンセル // -(void)touchesCanceled:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"[CANCELED]"); }
関連記事
- [AIR3][ANE][iOS] iOSでAIR Native Extention (iOSからイベントを受け取る)
- [AIR3][ANE][iOS] ネットワーク状況の変化を通知してくれるNative Extension








