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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:40:59+00:00 2026-06-05T21:40:59+00:00

It is very easy to allow users to interact with views while animating using

  • 0

It is very easy to allow users to interact with views while animating using the options field of block based animation. But in my program I am using a CAKeyframeAnimation and I don’t see any properties to set user interaction enabled. Is there any way to do this?

Thanks,

EDIT: Here is the actual code:

- (void)move
{
    CGMutablePathRef path = CGPathCreateMutable();
    CGPathMoveToPoint(path, NULL, 50, 120);
    for (int i = 0; i < 5; i ++)
        CGPathAddLineToPoint(path, NULL, arc4random() % 320, arc4random() % 480);
    CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
    [animation setPath:path];
    [animation setDuration:10];
    CFRelease(path);
    [self.layer addAnimation:animation forKey:@"move"];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self setAlpha:0];
}
  • 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-05T21:41:01+00:00Added an answer on June 5, 2026 at 9:41 pm

    You are most likely touching the wrong place. When the layer animates on screen the value never changes so the view is actually positioned where it was from the beginning, not where it appears on screen.

    I did a blog post a few month ago on how to hit test animating layers. It describes the exact thing that you are trying to do.

    You will need to add the touch handling (or gesture recognizer) to the superview and do the hit-testing of the presentationLayer yourself to determine if the user tapped where the view appeared on screen.

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

Sidebar

Related Questions

Using interfaces is a very easy way to remove dependencies, but what happens when
I'm looking for a very easy way to allow users to upload files (html)
Maybe this is something very easy to do it but so far it's taking
This is hopefully very easy to do, but I can't find any doco on
This is probably very easy to do but for some reason I can't seem
This should be very easy but I don't know how to do it. I
This seems like it should be something very easy to do, but every time
WPF makes it very easy to create conditional formatting rules at design time based
It's very easy to force a taskbar icon to display a balloon tooltip: all
It's very easy to set a text editor to use spaces or tab characters

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.