• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with CAAnimation in a screensaver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with CAAnimation in a screensaver


  • Subject: Problem with CAAnimation in a screensaver
  • From: Gabriel Zachmann <email@hidden>
  • Date: Thu, 29 Sep 2016 01:01:17 +0200

In my screensaver, I use layers and explicit animations to animate the bounds (size) of the layer.
At some point, I'd like to pause the animation.
I am trying to do that by setting the duration of the animation to a very large value.
The effect is that the layer still changes its bounds , i.e., it grows and  shrinks  --
however, the screensaver's animateOneFrame() function does not get called any more.

(Code snippets below)

Any ideas why that is?
All insights and hints will be appreciated.

Best regards,
Gabriel.


Code snippets:


This is how I create and set the animation:

       CALayer * imgLayer = [CALayer layer];
...
	CABasicAnimation * anim = [CABasicAnimation animationWithKeyPath: @"bounds.size"];
        anim.duration	= 30.0;
...
	[imgLayer addAnimation: anim forKey: @"myBoundsAnim"];
       CABasicAnimation * fadein = [CABasicAnimation animationWithKeyPath: @"opacity"];
 ...
        [imgLayer addAnimation: fadein forKey: nil];
        [mainLayer_ addSublayer: imgLayer];
        currentLayer_ = imgLayer;				// this is an ivar



This is how I am trying to pause the zooming animation in the  -animateOneFrame  method of the screensaver:

        CAAnimation * zoominganim = [ currentLayer_ animationForKey: @"myBoundsAnim" ];
        zoominganim.duration = 1e100;





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem with CAAnimation in a screensaver
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Best way to make a little piece of data persistent?
  • Next by Date: Re: Best way to make a little piece of data persistent?
  • Previous by thread: Best way to make a little piece of data persistent?
  • Next by thread: Re: Problem with CAAnimation in a screensaver
  • Index(es):
    • Date
    • Thread