티스토리 뷰



간단하다. 터치를 탭쳐하고자하는 ViewController에서 다음의 함수들을 오버라이트하면 된다.

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

{

NSLog(@"Touch begined");

UITouch *touch = [[event allTouchesanyObject];

CGPoint pos = [touch locationInView: [UIApplicationsharedApplication].keyWindow];

NSLog(@"Position of touch: %.3f, %.3f", pos.x, pos.y);

 

}


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

{

NSLog(@"Touch moved");

}


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

{

NSLog(@"Touch ended");

}


공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함