@@ -26,8 +26,7 @@ Please note below that _\<platform\>_ is used to represent the platform on which
2626#### Cocoapod
27271 . Add the following lines to the _ Podfile_ :<pre >
2828 ``` use_frameworks! ```
29- ``` pod 'OptimizelySDK', :git => 'https://github.com/optimizely/swift-sdk.git', :branch => 'master' ```
30- ``` pod 'OptimizelySDK', :path => '~/Development/swift-sdk' ```
29+ ``` pod 'OptimizelySwiftSDK', '3.1.0-beta ```
3130</pre >
3231
33322 . Run the following command: <pre >``` pod install ``` </pre >
@@ -51,21 +50,27 @@ github "optimizely/swift-sdk" "master"
5150 - In the script area include:<pre >
5251 ``` /usr/local/bin/carthage copy-frameworks ``` </pre >
5352 - Add the frameworks to the ** Input Files** list:<pre >
54- ``` $(SRCROOT)/Carthage/Build/<platform>/OptimizelySDK .framework ```
53+ ``` $(SRCROOT)/Carthage/Build/<platform>/Optimizely .framework ```
5554 </pre >
5655
5756Futher installation instructions for Carthage: https://github.com/Carthage/Carthage
5857
58+ A sample code for SDK initialization and experiments:
59+
5960```
60- let optimizely = OptimizelyClient(sdkKey:"somesdkkey")
61-
62- if let _ try? = optimizely.start(datafile:json) {
63- let variation = optimizely.activate(experimentKey: "background_experiment", userId: "userId", attributes: ["doubleKey":5])
64-
65- let basicVariation = optimizely.track(eventKey: "sample_conversion", userId: "userId")
66- }
61+ let optimizely = OptimizelyClient(sdkKey:"somesdkkey")
62+
63+ optimizely.start(datafile:json) { result in
64+ do {
65+ let variation = try optimizely.activate(experimentKey: "background_experiment", userId: "userId", attributes: ["doubleKey":5])
66+ try optimizely.track(eventKey: "sample_conversion", userId: "userId")
67+ } catch {
68+ print(error)
69+ }
70+ }
6771```
6872
73+
6974### Contributing
7075Please see [ CONTRIBUTING] ( CONTRIBUTING.md ) .
7176
0 commit comments