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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:49:42+00:00 2026-05-26T15:49:42+00:00

When I use : CALayer *hitLayer = [[self.view.window.layer presentationLayer] hitTest:pointOfTouch]; I then explore the

  • 0

When I use :

CALayer *hitLayer = 
[[self.view.window.layer presentationLayer] hitTest:pointOfTouch]; 


I then explore the layer to discover that all the property that are animating at the moment are set to their final states.

The layer I'm testing on is the CALayer of an UIImageView in iOS 4.3.
I also have an IBOutlet to that UIImage view. So I did the same test like this:

  CALayer *l = [self.topLeft.layer presentationLayer];
  NSLog(@"presentation layer frame for eloise is : %@", [self cgRectDescription:l.frame]);
  NSLog(@"and xPosition = %.2f, yPosition = %.2f & zPosition = %.2f", l.position.x, l.position.y, l.zPosition);


And I still get the same result.
I'm testing this in (void)touchesBegan:withEvent: while the image is moving.
Here is the animation I'm using

[UIImageView animateWithDuration:aDuration
                            delay:0
                          options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState
                       animations:^(void) {
                                  aIv.center = imageStartingPoint;
                                  aIv.layer.zPosition = 0;
                                  imageStartingPoint = CGPointZero;
                                  centerImage = nil;

CABasicAnimation *ba = [CABasicAnimation animationWithKeyPath:@"shadowOffset"]; ba.fromValue = [NSValue valueWithCGSize:aIv.layer.shadowOffset]; ba.toValue = [NSValue valueWithCGSize:CGSizeMake(0, 0)]; aIv.layer.shadowOffset = CGSizeMake(0, 0); ba.duration = aDuration; ba.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; [aIv.layer addAnimation:ba forKey:@"shadowOffset"]; ba = [CABasicAnimation animationWithKeyPath:@"shadowRadius"]; ba.fromValue = [NSNumber numberWithFloat:aIv.layer.shadowRadius]; ba.toValue = [NSNumber numberWithFloat:0]; aIv.layer.shadowRadius = 0; ba.duration = aDuration; ba.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; [aIv.layer addAnimation:ba forKey:@"shadowRadius"]; } completion:NULL]; </pre> </code>

It's probably a little simple thing, but I'm out of idea, thanks,

  • 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-05-26T15:49:43+00:00Added an answer on May 26, 2026 at 3:49 pm

    I’ve got a solution.

    I just explored an idea, I realize that I didn’t check if the value of the CABasicAnimation(s) where behaving correctly in the presentation layer… and… they were.
    I had to do those 2 in explicit animation, because implicit was not supported.

    So I made some more basic animation for the center of the image and the zPosition.
    And now I have the information in the presentation layer.

    So for now I can conclude that if you need to get a valid presentation layer you absolutely need to do EXPLICIT animation with a CAAnimation.

    I’m kind of sad, because I was liking the UIView animateWithDuration:…

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

Sidebar

Related Questions

In my app, I use method [self DismissModalView...] to dismiss a search view, everything
We use a data acquisition card to take readings from a device that increases
For some reason I get linker errors when I try and use CALayer: _OBJC_CLASS_$_CALayer,
I have a CALayer that I want to animate across the screen. I have
I am trying to use Mizage's window flipper library in my Mac app. When
I have a custom UIView subclass that i'm trying to use as a header
For apple said that we can't use drawRec: in a UIImageView. so I decide
When subclassing an CALayer and implementing the drawInContext method, I would assume that any
I am aware that a CALayer's shadowPath is only animatable using explicit animations, however
well I have a CALayer layer and I would like to move it, with

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.