Search code examples
objective-cxcodecore-animation

Line animation in Xcode


I am trying to do animating line drawing in xcode. I am developing for iPhone. I found some tutorials which use CABasicAnimation. But, when I try to create an CABasicAnimation object like this

CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];

I get an error: use of undeclared identifier CABasicAnimation.

Do I need some library for using CABasicAnimation object? I am not sure how is this working. Is there any tutorial that explain complete process of animation in Xcode, because all I found is starting with defining CABasicAnimation object, without any explanation what should I configure or import before.

I am using XCode 4.4.1 and a Mountain Lion. Thanks a lot!


Solution

  • You need to include QuartzCore.framework into your project and #import <QuartzCore/QuartzCore.h> in your code

    enter image description here