0

I'm building an today extension (widget) in iOS and was hoping it would be possible to add some subtle animations. Specifically i'm trying to transition a text label when the text changes.

My code works as expected in a regular app, but not in the widget. The text changes, but there is no transition.

    CATransition *animation = [CATransition animation];
    animation.duration = 3.0;
    animation.type = kCATransitionFade;
    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [self.heading.layer addAnimation:animation forKey: nil];
    self.heading.text = @"Lorem ipsum dolor sit amet";

This snippet is run inside the viewDidAppear method

Kampai
  • 22,848
  • 21
  • 95
  • 95
Trj
  • 657
  • 9
  • 21

1 Answers1

1

CoreAnimation should definitely be available from extensions. Any API that isn't available from within an extension should have its declaration marked with NS_EXTENSION_UNAVAILABLE (visible in the API's header file).

James Bedford
  • 28,702
  • 8
  • 57
  • 64
  • 1
    Not sure what caused it to not function properly, but i've experienced som bugs with the extensions in iOS 8 before as well. Marked this as an answer because of the useful NS_EXTENSION_UNAVAILABLE – Trj Oct 14 '14 at 15:55
  • The best thing to do in that case would be to file a bug using Bug Reporter with good reproduce steps (attaching an example project demonstrating the bug would be absolutely perfect). https://developer.apple.com/bug-reporting/using-bug-reporter – James Bedford Oct 15 '14 at 18:48