Note:
The following will allow you to setup Rollout SDK in case your AppDelegate is in Swift.
Update:
Rollout SDK 1.1.0 has Swift interface for calling the setup, so all the following info is not relevant now.
The original answer:
1. Swift-ObjC Bridging Header
To call [Rollout setupWithDebug:]
from Swift, you should have Objective-C Bridging Header set and <Rollout/Rollout.h>
should be imported from it:
- In the build settings, check if SWIFT_OBJC_BRIDGING_HEADER is already set. If yes, go to step 4
- Create a C header (File -> New -> File... -> iOS -> Source -> Header File). Call it somehow, e.g.
ObjC-Bridging-Header
- Go to the build settings and set
SWIFT_OBJC_BRIDGING_HEADER
to point to the file you've created (ObjC-Bridging-Header.h
). A relative path is required in the setting if the file is not at the project's root - more details in this SO answer
Go to the header and add the import line there:
#import <Rollout/Rollout.h>
2. #if debug
In order to allow Rollout testing mode (for easy hot-patches testing) it's also required to translate #ifdef Debug
from ObjC . This can be done by setting OTHER_SWIFT_FLAGS
in build settings like this:

3. Call setup from AppDelegate.swift
Now you can add the following lines to application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?)
:
#if DEBUG
Rollout.setupWithKey("<rollout_key>", developmentDevice: true)
#else
Rollout.setupWithKey("<rollout_key>", developmentDevice: false)
#endif