Add the SDK through CocoaPods
We use CocoaPods in order to make installing and updating our SDK super easy. CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.
If you don’t have CocoaPods installed on your machine you can install it by issuing the following command in your terminal:
After that you need to go to the project’s directory and initialize CocoaPods
This will also create a special file called a Podfile, where you can specify what dependencies to add to your new project. Usually it will look similar to this:
You can add the SDK to your project by declaring the following Pod:
This will tell CocoaPods to fetch the latest version of the iOS Publisher SDK. This will contain everything you need in order to load and display banner, interstitial and video ads.
After the pod source has been added, update your project’s dependencies by running the following command in the terminal:
Don’t forget to use the .xcworkspace file to open your project in Xcode, instead of the .xcproj file, from here on out.
You can import the main SDK header file like so:
#import "SuperAwesome.h" @import SuperAwesome;