Instreamatic
Search…
Manual for SWIFT apps

Embedding to Swift apps

First, download the library from HERE
For integration libAdman.a with your Swift app please follow next steps:
  • Include files from archive to active Xcode project
  • Add Objective-C bridging header and include all .h files from the library archive
  • Add next line to Library search path in build settings:
1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
Copied!
Please note, that you will find three libraries in the archive:
  • libAdman - this library is not linked with AFNetworking and/or SocketRocket
  • libAdman_SR - this library is linked with SocketRocket
  • libAdman_AF30 - thisl ibrary is linked AFNetworking and SocketRocket
Please find the one you need, rename it to libAdman.a and add to your project.

Swift example

1
import UIKit
2
3
class ViewController: UIViewController, AdmanDelegate {
4
5
override func viewDidLoad() {
6
super.viewDidLoad()
7
let adm = Adman.sharedManagerWithSiteId(1249, region: .regionGlobal, testMode: false)
8
adm.delegate = self
9
adm.prepare()
10
}
11
12
func stateDidChange(sender: Adman) {
13
switch sender.state {
14
case .ReadyForPlayback:
15
sender.showDefaultView(self)
16
break
17
default:
18
break
19
}
20
}
21
22
func viewClosed() {}
23
func bannerTouched(urlToNavigate: String!) {
24
}
25
26
override func didReceiveMemoryWarning() {
27
super.didReceiveMemoryWarning()
28
// Dispose of any resources that can be recreated.
29
}
30
}
Copied!
Last modified 1yr ago