Error in import MoPub statement in swift app

ios
swift

#1

I’m trying to integrate MoPub in a swift app, but it shows an error when I try to import MoPub.
I think MoPub is failing for not having a step by step implementation for swift developers :confused:

Any help, much appreciated,

Thanks in advance


#2

Hi nissivm–

To use the MoPub SDK in your Swift project, simply import MoPubSDK/MoPub-Bridging-Header.h to your project and ensure the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header.

You may also find it helpful to look at the sample app for Fabric - Cannonball? That is also written in Swift.

Alice


#3

The path to MoPub.framework and Fabric.Framework need to be added to the Framework Search paths in Build Settings.


#4

Actually, I’m having trouble adding the MoPub framework as a framework in cocoapods too. I can’t use the class “MoPub” plus I can’t import the header file from the pods installation either. Is it actually possible to use that sdk as a cocoapod framework?


#5

You probably need to use #import <mopub_ios_sdk/MoPub-Bridging-Header.h> Had same problem, found answer here - http://onebigfunction.com/ios/2015/12/31/mopub-mo-problems/