Skip to content

Instantly share code, notes, and snippets.

@timelincoln7648
Created January 10, 2020 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timelincoln7648/d5943afbf330aad38e68437c1c013f79 to your computer and use it in GitHub Desktop.
Save timelincoln7648/d5943afbf330aad38e68437c1c013f79 to your computer and use it in GitHub Desktop.
Install Optimizely Swift
import UIKit
import Optimizely
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// Build OptimizelyClient
let optimizely = OptimizelyClient(sdkKey: "REPLACE_WITH_SDK_KEY", periodicDownloadInterval: 30)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
optimizely.start { result in
switch result {
case .failure(let error):
print("Optimizely SDK initiliazation failed: \(error)")
case .success:
print("Optimizely SDK initialized successfully!")
}
}
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment