Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7774221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:19:22+00:00 2026-06-01T17:19:22+00:00

I have a UIView that a user drags around via setting its center in

  • 0

I have a UIView that a user drags around via setting its center in the touchesMoved: method. When the user lets go, I want the UIView to fall off the screen according to how fast and what direction they were moving it in.

Do I need to somehow create a vector by comparing the UIView‘s last center point to it’s new center point? And subtract a fixed amount to the vector’s y value every so often with a NSTimer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:19:23+00:00Added an answer on June 1, 2026 at 5:19 pm

    Yes, you will need to a decent amount of physics in calculating

    1. Speed of swipe
    2. Direction of swipe

    You will need to use the touchesMoved method along with a timer to track the amount of time for the swipe and also the co-ordinates for the new location of the object. This should be fairly straight forward. Once you are done finding those you can simply add a UIAnimation for the object to move to its new place.

    ~ A suggestion:

    I would suggest that you have a look at Cocos2D and integrate the library with you app. You will not need to implement touch delegate methods and compute things yourself ~ there are libraries for that 🙂 It has a lot of libraries especially for moving objects (or sprites if you wish to call them that way) and you have animation method like easeInEaseOut, etc.. that can be impacted on the moving object. If you are developing a game of some sort, have a look at chipMunk engine in Cocos2D as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView that I want to load when the user clicks a
I have subclassed a UIView that already handles single touches and drags. I want
I have a UIView subclass that moved around 'event's when the user touches them,
I have an application that starts playing a sound when user touches the uiview
I have a UIView that contains a UIScrollView and I want to be able
I have a UIView that allows the user to draw a line (myLine) on
I have a small UIView that displays a repeated movie. When the user taps
I have a UIView animation (called by a touchesEnded: event) that I want to
I have an UIImageView inside an UIScrollView. I want that the user can zoom
I have a UIView that a user can add subviews to. I now need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.