Sciguy77
Sciguy77

Reputation: 349

Calling a function in UIView class? With Obj C on Xcode

I'm trying to call a function called animateRight in a file called ScanAnimation.m from SecondViewController.m.

In the top of SecondViewController.m I have:

ScanAnimation * Animation = [[ScanAnimation alloc] init];

and I make the call with:

[Animation animateRight];

and I get the error:

'ScanAnimation' undeclared

What am I doing wrong?

Upvotes: 0

Views: 261

Answers (1)

Chance Hudson
Chance Hudson

Reputation: 2859

You need to import the ScanAnimation header file into the file you are making the call in.

So in the SecondViewController.m you would add #import "ScanAnimation.h" at the top under #import "SecondViewController.h"

Upvotes: 1

Related Questions