Cocoapods Swift does not work with use_frameworks! Fix

I have a mixed Objective-C/Swift project and activated use_frameworks! in my podfile because I wanted to use a Swift-based pod. In order to enable the usage of the Objective-C-based pods in your Swift code, I thought it would be necessary to stick to the common approach of including the pods’ header files into a bridging header file and configure the project in Xcode accordingly. Like so.

But, as it turns out, you do not have to do this if add use_frameworks! is active in your podfile. All you need to do is import the according pod framework directly in your Swift code. For instance, when using AFNetworking add an
import AFNetworking
to the top of your Swift file. That is all.

Tagged with: cocoa pods, import, podfile, problem, swift