问题
I am using RestKit along with some Swift only frameworks and when I use the cocoapods use_frameworks! flag, I get compile errors. It can't find CoreData.h in the bridging header and can't find RKValueTransformers.h
If I remove the flag it all compiles correctly.
Anyone else seen this? Is there a workaround
回答1:
As far as I know one can only use either Objective-C or Swift libraries in the bridging-header. There is no solution enabling you to use both Objective-C and Swift libraries in the bridging-header. I would say, use the bridging-header for the Objective-C libraries and import Swift libraries manually into the project.
回答2:
I've had a long struggle with this, too, while I was building a private Swift-Framework-Pod that depends on RestKit. After a long fight, I forked RestKit and hacked a workaround.
The drawbacks are, you have to use Cocoapods 0.39, which is pretty legacy and the hacked version of RestKit is forked of 0.25.0, so it's also not the newest of the new.
To use the fork, in your Podfile, replacepod 'RestKit', ...
withpod 'RestKit', :git => 'https://github.com/resmio/RestKit', :tag => 'v0.25.0-use-frameworks'
Also, you might need to use a hacked version of AFNetworking, which also made some problems.
Same here, replacepod 'AFNetworking', ...
withpod 'AFNetworking', :git => 'https://github.com/resmio/AFNetworking', :tag => 'v1.3.4-use-frameworks'
I'd be glad if you'd let me know if that wrked for you and if so, spread the word! :)
回答3:
Finally RestKit's latest versions worked. However, I have since switched to SYNC and AlamoFire for all my syncing needs. YMMV
来源:https://stackoverflow.com/questions/28933956/restkit-compile-fails-with-cocoapods-use-frameworks-for-swift