2

I've developed an application using Apple Swift but when I try to integrate AdColony in my project when I write this line of code in my AppDelegate.swift:

import AdColony

I receive the error: no module available.

How can I solve this issue? I've followed all the steps in the AdColony guide (also integrating the other frameworks).

Braiam
  • 1
  • 11
  • 47
  • 78
  • did you add the library/framework to the project before writing import? https://github.com/AdColony/AdColony-iOS-SDK/wiki/Xcode-Project-Setup – David Karlsson Jan 05 '15 at 00:36
  • I've followed all the steps in the guide also including all the frameworks before using import instruction, the guide is relative only to Objective-C and doesn't explain nothing about Apple Swift – Roberto Scarciello Jan 07 '15 at 00:24

1 Answers1

4

Since the AdColony framework is Objective-C-based, you'll need to create a bridging header for your project. Here's Apple’s documentation. You’ll want to look at the section called Importing Objective-C into Swift.

Note that you’ll need to import AdColony using Objective-C syntax in the bridging header file itself, not in your Swift classes:

#import <AdColony/AdColony.h>

Once you’ve accomplished that, the framework will now be visible in any of your Swift classes.

  • AdColony please i need help, see this post of mine http://stackoverflow.com/questions/40362875/adreward-from-adcolony-not-working-on-swift-2-0-for-some-reason – msqar Nov 01 '16 at 15:19