cocoabits/MASShortcut

xcode 6.2 compiling issues.

eicca opened this issue · 3 comments

Hello.

I'm using xcode beta and I'm trying to use MASShortcut within a swift project.

After importing MASShortcut in bridging header file I'm getting the following error during compilation:

<unknown>:0: error: /path/to/project/Pods/Headers/MASShortcut/MASShortcut.h:49: expected a type

And this is a MASShortcut.h:49:

+ (MASShortcut *)shortcutWithEvent:(NSEvent *)anEvent;

Maybe NSEvent is not in the carbon anymore?

I solved the issue by adding #import <Cocoa/Cocoa.h> on top of the MASShortcut.h, but I'm unsure if it's a proper solution. Also, if the problem is related to api changes, maybe it'd be a good idea to add the fix to the library as well.

Thanks.

Hi, thank you for the problem report. I assume NSEvent is declared in Cocoa.h, but the bridging header does not import this file. Could you please try to move the line #import <Cocoa/Cocoa.h> into the file ...-Bridging-Header.h or something like this? Sorry for the late reply.

Thanks, this works perfectly. Sorry for the trivial question ;)

No problem, glad it helped! :)