タッチしたときの座標取得

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

UITouch *touch = [touches anyObject];

CGPoint location = [touch locationInView:self.view];

[super touchesBegan:touches withEvent:event];

NSLog(@"タッチ開始 %0.1f, %0.1f", location.x, location.y);    

}


-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

{

UITouch *touch = [touches anyObject];

CGPoint location = [touch locationInView:self.view];

[super touchesBegan:touches withEvent:event];

NSLog(@"タッチ中 %0.1f, %0.1f", location.x, location.y);  

}


- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

{

UITouch *touch = [touches anyObject];

CGPoint location = [touch locationInView:self.view];

[super touchesBegan:touches withEvent:event];

NSLog(@"タッチ終了 %0.1f, %0.1f", location.x, location.y);  

}


コメント
コメントする








   
この記事のトラックバックURL
トラックバック

ロリポップ!レンタルサーバー

写真素材とか販売なう!


search this site.

calendar

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28293031   
<< May 2017 >>

selected entries

categories

archives

links

profile

others

mobile

qrcode

powered

無料ブログ作成サービス JUGEM