Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Xcode cannot find protocol declaration of "UIViewControllerAnimatedTransitioning"'

I created a vanilla Xcode (v6.2) project (Project A) that throws the error:

'Xcode cannot find protocol declaration of "UIViewControllerAnimatedTransitioning"'

Here's the code:

#import <Foundation/Foundation.h>

@interface WTF : NSObject <UIViewControllerAnimatedTransitioning>

@end

Weird thing is, I have a example project that I downloaded (Project B) that I can put the exact above code in and it will recognize UIViewControllerAnimatedTransitioning protocol without a problem:

#import <Foundation/Foundation.h>

@interface WTF : NSObject <UIViewControllerAnimatedTransitioning>

@end

The most obvious differences I notice between the two projects are that the second downloaded project has the frameworks listed in the explorer, but the project I created with Xcode 6.2 does not. Upon further reading I found that new versions of Xcode eliminate the need to manually hook up frameworks, so I'm not sure if it's relevant.

So with Project A throwing an error on something that Project B does not, I started a new project (Project C) in Xcode (Single View Application) and pasted in:

#import <Foundation/Foundation.h>

@interface WTF : NSObject <UIViewControllerAnimatedTransitioning>

@end

And get the same error:

'Xcode cannot find protocol declaration of "UIViewControllerAnimatedTransitioning"'

Restarted Xcode and Mac and the error persists.

WTF is happening here?

like image 325
Matt Miller Avatar asked Mar 02 '15 15:03

Matt Miller


1 Answers

Ugh. Needed to import

UIKit/UIKit.h

3 hours.

like image 198
Matt Miller Avatar answered Nov 07 '22 19:11

Matt Miller