Skip to content

Instantly share code, notes, and snippets.

Last active February 1, 2018 01:39
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Full code snippet for iOS getting started (Swift)
// AppDelegate.swift
// iOS Getting Started Guide (Objective C)
import UIKit
import OptimizelySDKiOS
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let optimizelyManager = OPTLYManager.init {(builder) in
builder!.projectId = "project_id"
optimizelyManager?.initializeWithCallback({ (error, client) in
let variation = client?.activate("my_experiment", userId: "currentUser")
client?.track("my_conversion", userId: "currentUser")
return true
Copy link

Can you change the following:
// iOS Getting Started Guide (Objective C) --> // iOS Getting Started Guide (Swift)

optimizelyManager?.initializeWithCallback({ (error, client) in --> optimizelyManager?.initialize(callback: {(error, optimizelyClient) in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment