Note that there are some explanatory texts on larger screens.

plurals
  1. POQuartzCore Not Animating?
    primarykey
    data
    text
    <p>I have a View Controller where I have setup a UIImageView and want to animate it with QuartzCore in Xcode - I built the UIImage to live in an Image View that rotates. This rotates fine when I was testing it in it's own project but now that I am pulling it into my current working project it adds the Image View but does not animate? No idea why? Any ideas?</p> <p>I don't have any errors or Warnings and it's the same code that was working in a separate project? I also have the QuartzCore library added and #imported</p> <pre><code>- (void)viewDidLoad { //Setup Image View UIImage *image = [UIImage imageNamed:@"record01.png"]; UIImageView *imgView = [[UIImageView alloc] initWithImage:image]; [imgView setFrame: CGRectMake(0, 0, image.size.width, image.size.height)]; [imgView setCenter:(CGPoint){160,160}]; [self.view addSubview:imgView]; //Animate Image View CABasicAnimation *fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; fullRotation.fromValue = [NSNumber numberWithFloat:0]; fullRotation.toValue = [NSNumber numberWithFloat:2 * M_PI]; fullRotation.duration = 1.5; fullRotation.repeatCount = HUGE_VALF; [imgView.layer addAnimation:fullRotation forKey:@"fullRotation"]; [super viewDidLoad]; // Do any additional setup after loading the view. } </code></pre> <p>Console for po [[UIApp keyWindow] recursiveDescription]</p> <pre><code> | | &lt;UIImageView: 0x984a9f0; frame = (-6.5 -6.5; 333 333); opaque = NO; userInteractionEnabled = NO; layer = &lt;CALayer: 0x984a040&gt;&gt; (lldb) po 0x984a040 (int) $2 = 159686720 &lt;CALayer:0x984a040; position = CGPoint (160 160); bounds = CGRect (0 0; 333 333); delegate = &lt;UIImageView: 0x984a9f0; frame = (-6.5 -6.5; 333 333); opaque = NO; userInteractionEnabled = NO; layer = &lt;CALayer: 0x984a040&gt;&gt;; contents = &lt;CGImage 0x9843560&gt;; rasterizationScale = 2; contentsScale = 2&gt; (lldb) </code></pre>
    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.
 

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