You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Optimizely+Decide/OptimizelyUserContext.swift
+18-11Lines changed: 18 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -131,28 +131,31 @@ public class OptimizelyUserContext {
131
131
/// - options: Optional array of decision options that will be used for this decision only
132
132
/// - completion: A callback that receives the resulting OptimizelyDecision
133
133
///
134
-
/// - Note: If the SDK is not ready, this method will immediately return an error decision through the completion handler.
134
+
/// - Note:
135
+
/// - If the SDK is not ready, this method will immediately return an error decision through the completion handler.
136
+
/// - The completion handler will be called on a background queue. If you need to update the UI, dispatch to the main queue within the completion handler.
/// Returns a decision result asynchronously for a given flag key
149
150
/// - Parameters:
150
151
/// - key: A flag key for which a decision will be made
151
152
/// - options: An array of options for decision-making
152
153
/// - Returns: A decision result
154
+
///
155
+
/// - Note: The completion handler will be called on a background queue. If you need to update the UI, dispatch to the main queue within the completion handler.
returnawaitwithCheckedContinuation{ continuation in
157
160
decideAsync(key: key, options: options){ decision in
158
161
continuation.resume(returning: decision)
@@ -187,8 +190,9 @@ public class OptimizelyUserContext {
187
190
/// - options: An array of options for decision-making.
188
191
/// - completion: A callback that receives a dictionary mapping each feature flag key to its corresponding decision result.
189
192
///
190
-
/// - Note: If the SDK is not ready, this method will immediately return an empty dictionary through the completion handler.
191
-
193
+
/// - Note:
194
+
/// - If the SDK is not ready, this method will immediately return an error decision through the completion handler.
195
+
/// - Note: The completion handler will be called on a background queue. If you need to update the UI, dispatch to the main queue within the completion handler.
192
196
publicfunc decideAsync(keys:[String],
193
197
options:[OptimizelyDecideOption]?=nil,
194
198
completion:@escapingDecideForKeysCompletion){
@@ -207,9 +211,11 @@ public class OptimizelyUserContext {
207
211
/// - keys: An array of flag keys for which decisions will be made
208
212
/// - options: An array of options for decision-making
209
213
/// - Returns: A dictionary of all decision results, mapped by flag keys
214
+
///
215
+
/// - Note: The completion handler will be called on a background queue. If you need to update the UI, dispatch to the main queue within the completion handler.
returnawaitwithCheckedContinuation{ continuation in
214
220
decideAsync(keys: keys, options: options){ decisions in
215
221
continuation.resume(returning: decisions)
@@ -239,7 +245,6 @@ public class OptimizelyUserContext {
239
245
/// The closure takes a dictionary of feature/experiment keys to their corresponding decision results.
240
246
///
241
247
/// - Note: The completion handler will be called on a background queue. If you need to update the UI, dispatch to the main queue within the completion handler.
@@ -253,6 +258,8 @@ public class OptimizelyUserContext {
253
258
/// Returns decisions for all active flag keys asynchronously
254
259
/// - Parameter options: An array of options for decision-making
255
260
/// - Returns: A dictionary of all decision results, mapped by flag keys
261
+
///
262
+
/// - Note: The completion handler will be called on a background queue. If you need to update the UI, dispatch to the main queue within the completion handler.
0 commit comments