Skip to content

Commit d84fb8e

Browse files
authored
Release 6.0 (#269)
## [6.0.0] - 2022-05-04 Note that Objective-C bridging types are prefixed by `Objc`, but that prefix is not exposed to code written in Objective-C. For example, changes listed to `ObjcLDClient` are changes to the class referred to as `LDClient` from within Objective-C. ### Added - Added the `LDValue` class to represent any data type that is allowed in JSON. This new type is used to provide more type safety when representing complex or non-statically determined data types. The SDK also provides the bridge types `ObjcLDValue` and `ObjcLDValueType` for Objective-C interoperability. - Added the `UserAttribute` class which provides a less error-prone way to refer to user attribute names in configuration. - Added the type specific variation functions, `boolVariation`, `intVariation`, `doubleVariation`, `stringVariation`, and `jsonVariation`, to `LDClient`. - Added the type specific detailed variation functions, `boolVariationDetail`, `intVariationDetail`, `doubleVariationDetail`, `stringVariationDetail`, and `jsonVariationDetail`, to `LDClient`. - Added `jsonVariation` and `jsonVariationDetail` to `ObjcLDClient`. These functions allow evaluating feature flags where the provided `defaultValue` and the resulting variation can be any valid JSON data type. - Added `ObjcLDJSONEvaluationDetail` for retrieving the detailed evaluation information of arbitrary type flag variations. - Added `ObjcLDChangedFlagHandler` type alias for new non-type specific Objective-C flag observers. ### Changed (API) - `LDClient.track(key: data: metricValue:)` no longer `throws`. - The type of the `data` parameter of `LDClient.track(key: data: metricValue:)` has changed from `Any?` to `LDValue?`. - `ObjcLDClient.track(key: data:)` and `ObjcLDClient.track(key: data: metricValue:)` no longer `throws`. In Objective-C this change means that the `track` functions no longer accept a `error:` parameter. - The type of the `data` parameter of `ObjcLDClient.track(key: data:)` and `ObjcLDClient.track(key: data: metricValue)` has changed from `Any?` to `ObjLDValue?`. In Objective-C this would be a change from `id _Nullable` to `LDValue * _Nullable`. - `LDClient.allFlags` now has the type `[LDFlagKey: LDValue]?` rather than `[LDFlagKey: Any]?`. - `ObjcLDClient.allFlags` now has the type `[String: ObjcLDValue]?` rather than `[String: Any]?`. In Objective-C this would be a change from `NSDictionary<NSString*, id> * _Nullable` to `NSDictionary<NSString*, LDValue*> * _Nullable`. - The type of the `LDUser.custom` dictionary, and the corresponding `LDUser.init` parameter has been changed from `[String: Any]?` to `[String: LDValue]`. - The type of the `ObjcLDUser.custom` property has been changed from `[String: Any]?` to `[String: ObjcLDValue]`. In Objective-C this would be a change from `NSDictionary<NSString*, id> * _Nullable` to `NSDictionary<NSString*, LDValue*> * _Nonnull`. - The type of the `LDUser.privateAttributes` property, and the corresponding `LDUser.init` parameter, have been changed from `[String]?` to `[UserAttribute]`. - The type of the `ObjcLDUser.privateAttributes` property has been changed from `[String]?` to `[String]`. In Objective-C this would be a change from `NSArray<NSString*> * _Nullable` to `NSArray<NSString*> * _Nonnull`. - The types of the properties `LDChangedFlag.oldValue` and `LDChangedFlag.newValue` have been changed from `Any?` to `LDValue`. - The type of the `LDConfig.privateUserAttributes` property has been changed from `[String]?` to `[UserAttribute]`. - `ObjcLDConfig.privateUserAttributes` now has the non-optional type `[String]` rather than `[String]?`. In Objective-C this would be a change from `NSArray<NSString*> * _Nullable` to `NSArray<NSString*> * _Nonnull`. - The type of the `LDEvaluationDetail.reason` property has been changed from `[String: Any]` to `[String: LDValue]`. - The type of the `reason` property of `ObjcLDBoolEvaluationDetail`, `ObjcLDIntegerEvaluationDetail`, `ObjcLDDoubleEvaluationDetail`, and `ObjcLDStringEvaluationDetail` has been changed from `[String: Any]?` to `[String: ObjcLDValue]?`. In Objective-C this would be a change from `NSDictionary<NSString*, id> * _Nullable` to `NSDictionary<NSString*, LDValue*> * _Nullable`. ### Changed (behavioral) - The `Equatable` instance for `LDUser` has been changed to compare all user properties, rather than just the `key` property. - Using `"custom"` as a private attribute name in `LDConfig.privateUserAttributes` or `LDUser.privateAttributes` will no longer set all `LDUser` custom attributes private. - The automatically set `device` and `operatingSystem` custom attributes can now be set private. - SDK versions from 4.0.0 and less than 6.0.0 supported migration of cached flag data from any SDK version of at least 2.3.3. The 6.0.0 release only supports migration of cached flag data from SDK versions of at least 4.0.0. ### Removed - Removed `LDClient.variation(forKey: defaultValue:)` and `LDClient.variationDetail(forKey: defaultValue:)` functions. Please use the new type-specific variation functions instead (e.g. `LDClient.boolVariation(forKey: defaultValue:)`). - Removed the `LDFlagValueConvertible` protocol which was previously used to constrain the parameters and return types of the variation functions. - `LDErrorHandler` and `LDClient.observeError(owner: handler:)` have been removed. Please use `ConnectionInformation` instead. - Removed the `LDUser.init(userDictionary: )` and `ObjcLDUser.init(userDictionary: )` initializers, please use the explicit initializers instead. - Removed `LDUser.CodingKeys`. To refer to user attributes, please use `UserAttribute` instead. - Removed `LDUser.privatizableAttributes` and `ObjcLDUser.privatizableAttributes`. - Removed `ObjcLDUser.attributeCustom`. - The `LDUser.device` and `LDUser.operatingSystem` properties, and the corresponding `LDUser.init` parameters have been removed. These fields will be included in the `LDUser.custom` dictionary. - The `ObjcLDUser.device` and `ObjcLDUser.operatingSystem` properties have been removed. These fields will be included in the `ObjcLDUser.custom` dictionary. - The `ObjcLDClient` functions, `arrayVariation`, `arrayVariationDetail`, `dictionaryVariation`, and `dictionaryVariationDetail`, have been removed. Please use `ObjcLDClient.jsonVariation` and `ObjcLDClient.jsonVariationDetail` instead. - The per-type instances of `ObjcLDChangedFlag` have been removed. Please use the base class `ObjcLDChangedFlag`, which now provides `oldValue` and `newValue` `ObjcLDValue` properties. The removed classes are `ObjcLDBoolChangedFlag`, `ObjcLDIntegerChangedFlag`, `ObjcLDDoubleChangedFlag`, `ObjcLDStringChangedFlag`, `ObjcLDArrayChangedFlag`, and `ObjcLDDictionaryChangedFlag`. - The classes `ObjcLDArrayEvaluationDetail` and `ObjcLDDictionaryEvaluationDetail` have been removed. Please use `ObjcLDJSONEvaluationDetail` instead. - The type aliases, `ObjcLDBoolChangedFlagHandler`, `ObjcLDIntegerChangedFlagHandler`, `ObjcLDDoubleChangedFlagHandler`, `ObjcLDStringChangedFlagHandler`, `ObjcLDArrayChangedFlagHandler`, and `ObjcLDDictionaryChangedFlagHandler`, have been removed. Please use `ObjcLDChangedFlagHandler` instead. - The `ObjcLDClient` functions, `observeBool`, `observeInteger`, `observeDouble`, `observeString`, `observeArray`, and `observeDictionary`, have been removed. Please use the non-type specific `ObjcLDClient.observe(key: owner: handler:)` instead.
1 parent 8e6d903 commit d84fb8e

File tree

122 files changed

+4063
-11548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+4063
-11548
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
- run:
111111
name: CocoaPods spec lint
112112
command: |
113-
if [ "$CIRCLE_BRANCH" = 'master' ]; then
113+
if [ "$CIRCLE_BRANCH" = 'main' ]; then
114114
pod spec lint
115115
else
116116
pod lib lint

.circleci/run-build-locally.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ curl --user ${CIRCLE_TOKEN}: \
1010
--request POST \
1111
--form config=@.circleci/config.yml \
1212
--form notify=false \
13-
https://circleci.com/api/v1.1/project/github/launchdarkly/ios-swift-client-sdk-private/tree/master
13+
https://circleci.com/api/v1.1/project/github/launchdarkly/ios-swift-client-sdk-private/tree/main

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
**Requirements**
22

33
- [ ] I have added test coverage for new or changed functionality
4-
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
4+
- [ ] I have followed the repository's [pull request submission guidelines](../blob/v6/CONTRIBUTING.md#submitting-pull-requests)
55
- [ ] I have validated my changes against all supported platform versions
66

77
**Related issues**

.jazzy.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ custom_categories:
1919
- LDConfig
2020
- LDUser
2121
- LDEvaluationDetail
22+
- LDValue
2223

2324
- name: Flag Change Observers
2425
children:
@@ -35,33 +36,25 @@ custom_categories:
3536

3637
- name: Other Types
3738
children:
39+
- UserAttribute
3840
- LDStreamingMode
39-
- LDFlagValueConvertible
4041
- LDFlagKey
4142
- LDInvalidArgumentError
42-
- LDErrorHandler
43+
- RequestHeaderTransform
4344

4445
- name: Objective-C Core Interfaces
4546
children:
4647
- ObjcLDClient
4748
- ObjcLDConfig
4849
- ObjcLDUser
4950
- ObjcLDChangedFlag
51+
- ObjcLDValue
52+
- ObjcLDValueType
5053

5154
- name: Objective-C EvaluationDetail Wrappers
5255
children:
5356
- ObjcLDBoolEvaluationDetail
5457
- ObjcLDIntegerEvaluationDetail
5558
- ObjcLDDoubleEvaluationDetail
5659
- ObjcLDStringEvaluationDetail
57-
- ObjcLDArrayEvaluationDetail
58-
- ObjcLDDictionaryEvaluationDetail
59-
60-
- name: Objective-C ChangedFlag Wrappers
61-
children:
62-
- ObjcLDBoolChangedFlag
63-
- ObjcLDIntegerChangedFlag
64-
- ObjcLDDoubleChangedFlag
65-
- ObjcLDStringChangedFlag
66-
- ObjcLDArrayChangedFlag
67-
- ObjcLDDictionaryChangedFlag
60+
- ObjcLDJSONEvaluationDetail

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,58 @@
22

33
All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [6.0.0] - 2022-05-04
6+
7+
Note that Objective-C bridging types are prefixed by `Objc`, but that prefix is not exposed to code written in Objective-C. For example, changes listed to `ObjcLDClient` are changes to the class referred to as `LDClient` from within Objective-C.
8+
9+
### Added
10+
- Added the `LDValue` class to represent any data type that is allowed in JSON. This new type is used to provide more type safety when representing complex or non-statically determined data types. The SDK also provides the bridge types `ObjcLDValue` and `ObjcLDValueType` for Objective-C interoperability.
11+
- Added the `UserAttribute` class which provides a less error-prone way to refer to user attribute names in configuration.
12+
- Added the type specific variation functions, `boolVariation`, `intVariation`, `doubleVariation`, `stringVariation`, and `jsonVariation`, to `LDClient`.
13+
- Added the type specific detailed variation functions, `boolVariationDetail`, `intVariationDetail`, `doubleVariationDetail`, `stringVariationDetail`, and `jsonVariationDetail`, to `LDClient`.
14+
- Added `jsonVariation` and `jsonVariationDetail` to `ObjcLDClient`. These functions allow evaluating feature flags where the provided `defaultValue` and the resulting variation can be any valid JSON data type.
15+
- Added `ObjcLDJSONEvaluationDetail` for retrieving the detailed evaluation information of arbitrary type flag variations.
16+
- Added `ObjcLDChangedFlagHandler` type alias for new non-type specific Objective-C flag observers.
17+
18+
### Changed (API)
19+
- `LDClient.track(key: data: metricValue:)` no longer `throws`.
20+
- The type of the `data` parameter of `LDClient.track(key: data: metricValue:)` has changed from `Any?` to `LDValue?`.
21+
- `ObjcLDClient.track(key: data:)` and `ObjcLDClient.track(key: data: metricValue:)` no longer `throws`. In Objective-C this change means that the `track` functions no longer accept a `error:` parameter.
22+
- The type of the `data` parameter of `ObjcLDClient.track(key: data:)` and `ObjcLDClient.track(key: data: metricValue)` has changed from `Any?` to `ObjLDValue?`. In Objective-C this would be a change from `id _Nullable` to `LDValue * _Nullable`.
23+
- `LDClient.allFlags` now has the type `[LDFlagKey: LDValue]?` rather than `[LDFlagKey: Any]?`.
24+
- `ObjcLDClient.allFlags` now has the type `[String: ObjcLDValue]?` rather than `[String: Any]?`. In Objective-C this would be a change from `NSDictionary<NSString*, id> * _Nullable` to `NSDictionary<NSString*, LDValue*> * _Nullable`.
25+
- The type of the `LDUser.custom` dictionary, and the corresponding `LDUser.init` parameter has been changed from `[String: Any]?` to `[String: LDValue]`.
26+
- The type of the `ObjcLDUser.custom` property has been changed from `[String: Any]?` to `[String: ObjcLDValue]`. In Objective-C this would be a change from `NSDictionary<NSString*, id> * _Nullable` to `NSDictionary<NSString*, LDValue*> * _Nonnull`.
27+
- The type of the `LDUser.privateAttributes` property, and the corresponding `LDUser.init` parameter, have been changed from `[String]?` to `[UserAttribute]`.
28+
- The type of the `ObjcLDUser.privateAttributes` property has been changed from `[String]?` to `[String]`. In Objective-C this would be a change from `NSArray<NSString*> * _Nullable` to `NSArray<NSString*> * _Nonnull`.
29+
- The types of the properties `LDChangedFlag.oldValue` and `LDChangedFlag.newValue` have been changed from `Any?` to `LDValue`.
30+
- The type of the `LDConfig.privateUserAttributes` property has been changed from `[String]?` to `[UserAttribute]`.
31+
- `ObjcLDConfig.privateUserAttributes` now has the non-optional type `[String]` rather than `[String]?`. In Objective-C this would be a change from `NSArray<NSString*> * _Nullable` to `NSArray<NSString*> * _Nonnull`.
32+
- The type of the `LDEvaluationDetail.reason` property has been changed from `[String: Any]` to `[String: LDValue]`.
33+
- The type of the `reason` property of `ObjcLDBoolEvaluationDetail`, `ObjcLDIntegerEvaluationDetail`, `ObjcLDDoubleEvaluationDetail`, and `ObjcLDStringEvaluationDetail` has been changed from `[String: Any]?` to `[String: ObjcLDValue]?`. In Objective-C this would be a change from `NSDictionary<NSString*, id> * _Nullable` to `NSDictionary<NSString*, LDValue*> * _Nullable`.
34+
35+
### Changed (behavioral)
36+
- The `Equatable` instance for `LDUser` has been changed to compare all user properties, rather than just the `key` property.
37+
- Using `"custom"` as a private attribute name in `LDConfig.privateUserAttributes` or `LDUser.privateAttributes` will no longer set all `LDUser` custom attributes private.
38+
- The automatically set `device` and `operatingSystem` custom attributes can now be set private.
39+
- SDK versions from 4.0.0 and less than 6.0.0 supported migration of cached flag data from any SDK version of at least 2.3.3. The 6.0.0 release only supports migration of cached flag data from SDK versions of at least 4.0.0.
40+
41+
### Removed
42+
- Removed `LDClient.variation(forKey: defaultValue:)` and `LDClient.variationDetail(forKey: defaultValue:)` functions. Please use the new type-specific variation functions instead (e.g. `LDClient.boolVariation(forKey: defaultValue:)`).
43+
- Removed the `LDFlagValueConvertible` protocol which was previously used to constrain the parameters and return types of the variation functions.
44+
- `LDErrorHandler` and `LDClient.observeError(owner: handler:)` have been removed. Please use `ConnectionInformation` instead.
45+
- Removed the `LDUser.init(userDictionary: )` and `ObjcLDUser.init(userDictionary: )` initializers, please use the explicit initializers instead.
46+
- Removed `LDUser.CodingKeys`. To refer to user attributes, please use `UserAttribute` instead.
47+
- Removed `LDUser.privatizableAttributes` and `ObjcLDUser.privatizableAttributes`.
48+
- Removed `ObjcLDUser.attributeCustom`.
49+
- The `LDUser.device` and `LDUser.operatingSystem` properties, and the corresponding `LDUser.init` parameters have been removed. These fields will be included in the `LDUser.custom` dictionary.
50+
- The `ObjcLDUser.device` and `ObjcLDUser.operatingSystem` properties have been removed. These fields will be included in the `ObjcLDUser.custom` dictionary.
51+
- The `ObjcLDClient` functions, `arrayVariation`, `arrayVariationDetail`, `dictionaryVariation`, and `dictionaryVariationDetail`, have been removed. Please use `ObjcLDClient.jsonVariation` and `ObjcLDClient.jsonVariationDetail` instead.
52+
- The per-type instances of `ObjcLDChangedFlag` have been removed. Please use the base class `ObjcLDChangedFlag`, which now provides `oldValue` and `newValue` `ObjcLDValue` properties. The removed classes are `ObjcLDBoolChangedFlag`, `ObjcLDIntegerChangedFlag`, `ObjcLDDoubleChangedFlag`, `ObjcLDStringChangedFlag`, `ObjcLDArrayChangedFlag`, and `ObjcLDDictionaryChangedFlag`.
53+
- The classes `ObjcLDArrayEvaluationDetail` and `ObjcLDDictionaryEvaluationDetail` have been removed. Please use `ObjcLDJSONEvaluationDetail` instead.
54+
- The type aliases, `ObjcLDBoolChangedFlagHandler`, `ObjcLDIntegerChangedFlagHandler`, `ObjcLDDoubleChangedFlagHandler`, `ObjcLDStringChangedFlagHandler`, `ObjcLDArrayChangedFlagHandler`, and `ObjcLDDictionaryChangedFlagHandler`, have been removed. Please use `ObjcLDChangedFlagHandler` instead.
55+
- The `ObjcLDClient` functions, `observeBool`, `observeInteger`, `observeDouble`, `observeString`, `observeArray`, and `observeDictionary`, have been removed. Please use the non-type specific `ObjcLDClient.observe(key: owner: handler:)` instead.
56+
557
## [5.4.5] - 2022-03-11
658
### Fixed
759
- Fixed race condition in `LDSwiftEventSource` that could cause a crash if the stream is explicitly stopped (such as when `identify` is called) while the stream is waiting to reconnect.

LaunchDarkly.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |ld|
33

44
ld.name = "LaunchDarkly"
5-
ld.version = "5.4.5"
5+
ld.version = "6.0.0"
66
ld.summary = "iOS SDK for LaunchDarkly"
77

88
ld.description = <<-DESC

0 commit comments

Comments
 (0)