how can you delete an image by using touches in the iphone sdk? Im making a game with images so i was wondering if there is a way were if you touch an image it gets deleted from the view.
Share
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.
Yes. You can add UITapGestureRecognizer to your image view, and in the recognizer action you can get the image view by using
recognizer.viewpropery. And you can delete/remove it from its super view by using[image removeFromSuperview]method.And the onImageTapped: method looks like this,