1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

how to get imageview tp follow a dragging touch?

Discussion in 'iPhone/iPad Programming' started by mandude, Jun 19, 2010.

  1. macrumors member

    #1
    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?
     
  2. macrumors 68030

    PhoneyDeveloper

    #2
    Look at the MoveMe sample code from Apple.
     

Share This Page