Bridging Header for Flurry.H Not Working with Pod

Bridging Header for Flurry.h not working with Pod

The problem wasn't Flurry Podspec. I was running an older cocoapods so updated it using

sudo gem install cocoapods

Flurry.h not found through bridging header when using cocoapods

Cocoapods 0.36 and later uses the use_frameworks! statement which means that bridging header is not required for importing Objective-C pods in Swift

What is a correct bridging header for Flurry?

When you are using latest CocoaPod to install external dependencies to Xcode Project, you don't really need the bridging header to expose Objective-C methods to Swift. See below screenshots once to understand it clearly.

Creating and Installing Pods.

Sample Image

Importing Flurry SDK in a Swift class.

Sample Image

Hope this helped. Thanks.

Bridging header doesn't work with two frameworks (Flurry)

Okay I found the solution. I just made a mistake and @BC_Dilum was right by adding

#import "Flurry/Flurry.h"

and not just #import Flurry.h

How to reference header files in Bridging-Header.h after updating CocoaPods to 0.36.x and above?

In your Podfile, you specified use_frameworks!.

As a result, the Objective-C code you're including as a dependency (DBSphereTagCloud) is packaged as a framework, instead of a static library. Please see CocoaPods 0.36 - Framework and Swift Support for more details.

As a consequence, you don't need a bridging header file. It's enough for you to add:

import DBSphereTagCloud

in all the Swift files that need that module.



Related Topics



Leave a reply



Submit