launchdarkly / ios-client-sdk

LaunchDarkly Client-side SDK for iOS (Swift and Obj-C)
https://docs.launchdarkly.com/sdk/client-side/ios
Other
68 stars 84 forks source link

Release 6.0 #269

Closed keelerm84 closed 2 years ago

keelerm84 commented 2 years ago

[6.0.0] - 2022-05-04

This major version has accompanying migration guides for Swift and Objective-C. Please see the guide for more information on updating to this version of the SDK, as the following is just a summary of the changes.

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

Changed (API)

Changed (behavioral)

Removed

simondelphia commented 2 years ago

Is there a replacement for LDFlagValueConvertible?

gwhelanLD commented 2 years ago

Yes, you can use LDValue similarly to LDFlagValueConvertible in order to represent all values that a flag variation could inhabit.

simondelphia commented 2 years ago

We have the following protocol that relies on it, not sure how to migrate it

public protocol Feature {
  associatedtype Value: LDFlagValueConvertible
  static var fallback: Value { get }
  static var key: String { get }
}

public extension Feature where Value == Bool {
  static var fallback: Value {
    false
  }
}

etc

gwhelanLD commented 2 years ago

We'll have some migration guides published on the docs site shortly that may be helpful. The impression I get from your code sample is that the Feature protocol is assisting in typing the variation method, which may be less necessary with the new specifically typed variation methods (e.g. boolVariation). I'll link the migration guides here when they go live.

gwhelanLD commented 2 years ago

Here are the migration guides for Swift and Objective-C.

simondelphia commented 2 years ago
image

This code sample in the migration guide linked above looks backwards? 5.x didn't have LDValue did it? Other samples seem fine.

gwhelanLD commented 2 years ago

Indeed you are correct, thanks for pointing out this issue in the migration guide. I've put a fix up internally, so it'll be fixed on the site as soon as it gets through review and release.

Thanks! @gwhelanLD