Subscribe ( )

iPhone Programming Tutorials

 

Forum

You must be logged in to post Login Register

Search 

Touch Sample Code

User Post

4:55 pm
November 22, 2008


bobcubsfan

iCoder

Los Angeles

posts 53

1

After many frustrating hours with code that contained too much, I wrote this sample code that simply reports the x and y coordinates of a touch, and reports if the target was hit or not. You are welcome to use it.


4:31 pm
February 24, 2009


Ricardo

Noob

posts 1

2

bobcubsfan, thanks I've taken 2 lines of your code:

UITouch *touch = [[event allTouches] anyObject];  

//this is the touch point
CGPoint location = [touch locationInView:touch.view];

I've already seen that in one of Brandon's tutorials which I was searching for when I found your sample code.


4:49 pm
February 24, 2009


bobcubsfan

iCoder

Los Angeles

posts 53

3

Happy to share!


About the iCodeBlog forum

Currently Online:

4 Guests

Maximum Online: 25

Forums:

Groups: 2

Forums: 6

Topics: 261

Posts: 689

Members:

There are 551 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 53

crazyiez - 30

VertigoSol - 26

AdeC - 17

Uhu - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)