Last active
February 1, 2018 01:39
-
-
Save mauerbac/4dd686a390b6cb305a358844568c0eb4 to your computer and use it in GitHub Desktop.
Full code snippet for iOS getting started (Swift)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AppDelegate.swift | |
// iOS Getting Started Guide (Objective C) | |
// | |
import UIKit | |
import OptimizelySDKiOS | |
@UIApplicationMain | |
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mauerbac
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