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 7879319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:52:33+00:00 2026-06-03T03:52:33+00:00

Is it possible to detect the collision of two UIImageViews while one is travelling

  • 0

Is it possible to detect the collision of two UIImageViews while one is travelling along a path during a CAKeyFrameAnimation?

If so how is this done, I have tried multiple methods including checking both the CGRects for collision during the animation – but can’t find a suitable method for performing a method during a CAKeyFrameAnimation and trying to detect collision of the path and the UIImageView.

  • 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-03T03:52:34+00:00Added an answer on June 3, 2026 at 3:52 am

    You need to get the properties from the presentation layer. It will have the best approximation of information that exists during animation. Access it by

    view.layer.presentationLayer
    

    Look at the documentation for CALayer/presentationLayer for more details.

    When you want to check for collisions, you would grab the presentationLayer of each object, then access whatever properties you want to test for collision. The exact way to check would depend on which type of layer, and whether you wanted simple hitTest-ing or depth checking. Only you know when and what type of collisions you want to look for.

    However, to access the properties of an object while it is animating, you need the presentationLayer.

    EDIT

    You can make these check whenever you want. You can do it in the context of another action, or with an NSTimer to do it at some interval. You can even use CADisplayLink, which while hook you into the animation timer itself.

    If you use CADisplayLink, I suggest setting frameInterval at the highest value possible, and still do what you want, so as to not impact performance.

        timer = [CADisplayLink displayLinkWithTarget:self selector:@selector(checkForCollisions)];
        // Callback is for every frame, which is 60 times per second.
        // Only callback every 6 frames (which is ten times per second)
        timer.frameInterval = 6;
        [timer addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    

    Don’t forget to invalidate the timer when you are done.

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

Sidebar

Related Questions

Is it possible to detect another finger touch during one finger is touching on
Possible Duplicate: Detect multitouch with Ontouch listener Android I have a question about detecting
Possible Duplicate: Detect Facebook page fan on the website I have a question to
Is it possible to detect if the visible map display more than one time
Is it possible to detect the system/processor architecture while the program is running (under
In cocos2d, i've got two objects that I want to detect collision with. Im
i am trying to detect Collision of two sprites in the following way...but when
Possible Duplicate: Detect element content changes with jQuery I have a wrapper div say
Possible Duplicate: Detect element content changes with jQuery I have a div with a
Possible Duplicate: Detect all changes to a <input type=text> (immediately) using JQuery I have

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.