jeudi 13 août 2015

Can I still use bridging header for cocoa pod frameworks?

I used to download Parse frameworks and bridge to my Swift project using bridging header file with this line:

#import <Parse/Parse.h>

Now I just switched to use cocoa pods and things get messed up when I include use_frameworks! in the Podfile. Keeping the bridging file the same, all of the PFObjects become unresolved identifier when build. This error goes away when I put

import Parse

at the top of each file. But that is pretty much every file since it is a Parse project, let alone other things to import such as ParseUI etc. Is there a way to import once for all as the bridging header used to do?

I tried to change the import line in the bridging header to:

import "Parse.h"

It gives me another error saying "duplicate interface definition for class 'Parse'":

MyApp/Pods/Parse/Parse/Parse.h:66:1: error: duplicate interface definition for class 'Parse'
@interface Parse : NSObject
^
/Library/Developer/Xcode/DerivedData/MyApp-dbdwtdjelpuomaaawugvjubngrvq/Build/Products/Debug-iphonesimulator/Parse.framework/Headers/Parse.h:66:12: note: previous definition is here
@interface Parse : NSObject
           ^

I checked other questions here but got no luck. Any help?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire