iPhone SDK Tutorial: Touches in a UIImageView Part 2

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
34,404
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 28, 2008

***iPhoneDevCentral.org tutorial...
A simple tutorial that teaches you how to set up your MainView, add a UIImageView, and move it with the touch and drag of your finger. This is with SDK Beta 4 and invloves no interface builder. Please visit iPhoneDevCentral.org for more tutorials on iPhone developement. Look me up in the forums under the name Nitrex88.

  • likes, 5 dislikes

Link to this comment:

Share to:

Top Comments

  • uhm....

    CGPoint location = [touch locationInView:touch.view];

    if(CGRectContainsPoint([square­View frame], location)){

    squareView.center = location;

    }

  • @siroganes THANK YOU so much

see all

All Comments (41)

Sign In or Sign Up now to post a comment!
  • hey nice tutorial, do you now how to make a program where you can move a picture only left or right, without up and down? so only the X-axis

    please help me :)

  • Can you do a tutorial returning the rgb values of a pixel touched?

  • What is the code if my image is moving and disappear when touched?

    Do I need to change the "anyObject? How does it change?

    I hope you can help me

    thanks

  • He sounds like a steriotypical nerd

  • hi i created an image in my app that the user can drag around however i would like it to follow a specific path so that when the user drags it it will not go outside of the path. how do i do this?

  • What is you don't have a reference to the squareView?

  • id it posible to make 2 imageviews and drag them separate

    i tried it but then the image that i drag stays visible, and the other is gone

    im using the 4.0 sdk

  • heh, I just couldn't resist. No offense anyway.

  • Whoops, I forgot!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more