Skip to content

Commit 223a97b

Browse files
authored
docs: update iOS SDK docs for non-throwing assignment methods (#692)
Remove try keyword from getStringAssignment, getBooleanAssignment, getIntegerAssignment, getNumericAssignment, and getJSONStringAssignment method calls since these methods no longer throw exceptions.
1 parent 88057c4 commit 223a97b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/sdks/client-sdks/ios/assignments.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ getJSONStringAssignment(...)
4040
String assignments return a string value that is set as the variation for the experiment. String flags are the most common type of flags and are useful for both A/B/n tests and advanced targeting use cases.
4141

4242
```swift
43-
let assignment = try eppoClient.getStringAssignment(
43+
let assignment = eppoClient.getStringAssignment(
4444
flagKey: "new-user-onboarding",
4545
subjectKey: user.id,
4646
subjectAttributes: user.attributes,
@@ -63,7 +63,7 @@ default:
6363
Boolean flags support simple on/off toggles. They're useful for simple, binary feature switches like blue/green deployments or enabling/disabling a new feature.
6464

6565
```swift
66-
let isEnabled = try eppoClient.getBooleanAssignment(
66+
let isEnabled = eppoClient.getBooleanAssignment(
6767
flagKey: "new-feature",
6868
subjectKey: user.id,
6969
subjectAttributes: user.attributes,
@@ -83,15 +83,15 @@ The SDK supports both integer and numeric assignments. These are useful for test
8383

8484
```swift
8585
// Integer assignment
86-
let itemCount = try eppoClient.getIntegerAssignment(
86+
let itemCount = eppoClient.getIntegerAssignment(
8787
flagKey: "items-per-page",
8888
subjectKey: user.id,
8989
subjectAttributes: user.attributes,
9090
defaultValue: 10
9191
)
9292

9393
// Numeric assignment
94-
let price = try eppoClient.getNumericAssignment(
94+
let price = eppoClient.getNumericAssignment(
9595
flagKey: "subscription-price",
9696
subjectKey: user.id,
9797
subjectAttributes: user.attributes,
@@ -112,7 +112,7 @@ let defaultConfig = """
112112
}
113113
"""
114114

115-
let config = try eppoClient.getJSONStringAssignment(
115+
let config = eppoClient.getJSONStringAssignment(
116116
flagKey: "ui-config",
117117
subjectKey: user.id,
118118
subjectAttributes: user.attributes,

docs/sdks/client-sdks/ios/quickstart.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let eppoClient = EppoClient.shared()
4747
let userId = getCurrentUserId() // Your user identification logic
4848
var attributes = ["userType": "premium", "country": "US"]
4949

50-
let isEnabled = try eppoClient.getBooleanAssignment(
50+
let isEnabled = eppoClient.getBooleanAssignment(
5151
flagKey: "new-feature",
5252
subjectKey: userId,
5353
subjectAttributes: attributes,
@@ -92,7 +92,7 @@ eppoClient = try await EppoClient.initialize(sdkKey: "<SDK-KEY>", assignmentLogg
9292
Then use the SDK to make experiment assignments:
9393

9494
```swift
95-
let assignment = try eppoClient.getStringAssignment(
95+
let assignment = eppoClient.getStringAssignment(
9696
flagKey: "new-user-onboarding",
9797
subjectKey: user.id,
9898
subjectAttributes: user.attributes,

0 commit comments

Comments
 (0)