Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Animation, unexpected animated position and hitTest values
    primarykey
    data
    text
    <p>When I use : <pre><code>CALayer *hitLayer = [[self.view.window.layer presentationLayer] hitTest:pointOfTouch]; </pre></code> I then explore the layer to discover that all the property that are animating at the moment are set to their final states.</p> <p>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: <pre><code> CALayer *l = [self.topLeft.layer presentationLayer]; NSLog(@"presentation layer frame for eloise is : %@", [self cgRectDescription:l.frame]); NSLog(@"and xPosition = %.2f, yPosition = %.2f &amp; zPosition = %.2f", l.position.x, l.position.y, l.zPosition);</pre></code> And I still get the same result.<br> I'm testing this in (void)touchesBegan:withEvent: while the image is moving.<br> Here is the animation I'm using <pre><code>[UIImageView animateWithDuration:aDuration delay:0 options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^(void) { aIv.center = imageStartingPoint; aIv.layer.zPosition = 0; imageStartingPoint = CGPointZero; centerImage = nil;</p> 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]; &lt;/pre&gt; &lt;/code&gt; </code></pre> <p>It's probably a little simple thing, but I'm out of idea, thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload