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

  • Home
  • SEARCH
  • 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 867847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:02:32+00:00 2026-05-15T10:02:32+00:00

On occasion when setting layer.transform to a new transform I see the layer blink

  • 0

On occasion when setting layer.transform to a new transform I see the layer blink at its finished location, then animate from its current location to its finished location.

I don’t know if this is related but at the same time I am setting the sublayerTransform on the layer’s superlayer.

I’ve really have no clue why this is happening, any thoughts would be appreciated.

Thanks.

Update

When I remove the sublayer transform, this behavior does not occur.

This is my initial setup.

I avoid implicit actions with my sublayerTransform with:

self.actions = [NSDictionary dictionaryWithObject:[NSNull null] forKey:@"sublayerTransform"];

This method transforms the individual layer

- (void)setSelectedCover:(int)cover{    
    selectedCover = cover;

    CoverLayer *coverLayer = [onScreenCovers objectForKey:[NSNumber numberWithInt:cover]];

    [CATransaction begin];
    [CATransaction setValue:[NSNumber numberWithFloat:0.3f]
                    forKey:kCATransactionAnimationDuration];

    coverLayer.transform = flippedUpTransform;
    [CATransaction commit];
}

This method creates a scroll like effect (I know there are more convenient ways of scrolling, but this is the best implementation for my needs so far) this method is called whenever the finger is moving on the screen.

- (void)setScrollOffset:(float)offset absolute:(BOOL)absolute animated:(BOOL)animated{
     CATransform3D aSublayerTransform = self.sublayerTransform;
     scrollOffset = aSublayerTransform.m41;

     if (absolute) {
        scrollOffset = offset;
     }else {
        scrollOffset += offset;
     }

     [self setValue:[NSNumber numberWithInt:scrollOffset] forKeyPath:@"sublayerTransform.translation.x"];
}

Also. I can only reproduce this on 2nd generation devices (not on 3rd) so it makes me think it is partly a device performance issue, but I still need a work around.

I have considered using a CABasicAnimation (explicit animations) like so:

  - (void)setSelectedCover:(int)cover{  
    selectedCover = cover;

    CoverLayer *coverLayer = [onScreenCovers objectForKey:[NSNumber numberWithInt:cover]];

    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
    animation.toValue = [NSValue valueWithCATransform3D:flippedUpTransform];
    animation.duration = 0.3f;

        [coverLayer addAnimation:animation forKey:@"transform"];
   }

This actually works really good, no flickering! the only problem now is making it stay.

So I added this to the animation:

animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;

This actually made it stay at the end of the animation but I think it is important for anyone who is working on a similar task to know that adding these two lines only makes the presentation layer stick, it does not persist it out to the model layer. In my case I have additional transforms for the the layer at hand if i want to transform again, by saying layer.transform = newtransform and the model was never changed, my layer will revert to its original transform before I executed the explicit animation.

So I thought I had a pretty good fix for the problem of persisting the transform. I added:

animation.delegate = coverLayer.delegate;

In my case each layer that gets animated, needs its own delegate because I could have multiple layers animating at the same time because things move so quickly. so I want each layer responsible for it self.

This is what I implemented in the delegate.

- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{

   if (flag) {

    [CATransaction begin];
    [CATransaction setValue:(id)kCFBooleanTrue
                     forKey:kCATransactionDisableActions];
    cover.transform = flippedUpTransform;
    [CATransaction commit];
    [cover performSelector:@selector(removeAllAnimations) withObject:nil afterDelay:0.2];

   }
}

If the animation completed successfully I take the finished transform and apply it to the model itself

Shortly after I remove the explicit animation because when other transforms are set, it will run the animation I last added.

This works.

If the animation did not complete I do nothing . I don’t need to update the modal layer because the animation that interrupted should be responsible for picking up where this one left off and making sure the presentation is persisted.

The problem is relying on delayed calls to always be right on. They aren’t, It keeps it together enough, but sometimes things can look a little off. In the end I will accept this solution If I can’t further rectify it. It just isn’t as smooth…

  • 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-15T10:02:33+00:00Added an answer on May 15, 2026 at 10:02 am

    iOS4 update resolves this issue.

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

Sidebar

Related Questions

I'm working on a Qt/C++ project, and one of its functions is setting up
Im working on an Occasion Reminder rails app where users can register then set
On occasion I get the following error when trying to synchronize from SQL Express
On occasion, my local Rails app loses its connection to MySQL. I get some
For some reason, on occasion, I get the following fatal error from my PHP
On occasion, I have wanted to push a closure onto ActionScript's event stack so
I have occasion to need to print code (Horrors!!! ;) ), and i was
A friend recently had the occasion for a legal name change, which made me
It looks like there are reports released on occasion that detail downloads for some
I’m fairly new at C# and MVC and have used lambdas on certain occasions,

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.