I’m programming a King Chess game on the iPhone. When the user touches a square on the screen, I want to know which square was selected.
I am using UIImageViews to show squares on the screen.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
in touchesEnded: method , u can get the position of ur touch.
Then , u go thru all the image views (squares) , comparing their frame positions using CGRectIntersectsRect and find which square is touched.