PDA

View Full Version : how to get imageview tp follow a dragging touch?




mandude
Jun 19, 2010, 02:39 AM
so i have a UIImageView that contains a PNG image on the bottom of the screen. The center point of this ImageView is the point (32, 420). I want it so that whenever the user touches this ImageView, the imageView instantly follows where ever the user's finger is, as long as the user's finger is touching the screen. If the user is dragging the image then lifts their finger up i want it also that the ImageView instantly returns with the center point of the ImageView being (32, 420). I belive i need something like -(void)touchesBegan...... i need some help putting this together thanks!


all i have so far is the h. file code

UIImageView *imageView;




what should go in the m. file?



PhoneyDeveloper
Jun 19, 2010, 09:20 AM
Look at the MoveMe sample code from Apple.