-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SK2StoreProduct
: simplify currencyCode
extraction
#2485
Conversation
We should also look into exposing the |
|
||
var _currencyCode: String { | ||
if #available(iOS 16.0, tvOS 16.0, watchOS 9.0, macOS 13.0, *) { | ||
// This is marked as `@_backDeploy`, but it's not actually working before iOS 16.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol why am I not surprised
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a radar for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I figured out the reason: this only works in whatever version of the SDK added this, but you can't use if it you're compiling with Xcode 13.x obviously... but the docs don't even say when it was added.
@objc public var priceFormatter: NumberFormatter? { self.product.priceFormatter } | ||
@objc public var priceFormatter: NumberFormatter { self.product.priceFormatter } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this make it a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah which is why I made it a feat
. But I had to revert this to fix Xcode 13.x compilation 🤷🏻♂️
Won't matter in the long term since you can't submit apps with that anymore, but we need to keep support for it in CI until I finish #2421.
3621fcd
to
b18891c
Compare
c1d8ef5
to
875a31a
Compare
I noticed this new property thanks to [this tweet](https://twitter.com/ariskox/status/1658067009609904129?s=61&t=Zz639sMJdwHISm4AKYXoCw). ## Changes - Removed `SK2StoreProduct.jsonDict` - Obtaining `SK2StoreProduct.currencyCode` from [the new (backdeployed) property](https://developer.apple.com/documentation/storekit/product/4044347-priceformatstyle) - Thanks to that, `StoreProductType.priceFormatter` no longer needs to be `Optional` Because of that change, I'm making this a "feature" since it'll need a minor release, for users that are currently relying on that property being `Optional`.
136e2da
to
39d2666
Compare
Codecov Report
@@ Coverage Diff @@
## main #2485 +/- ##
==========================================
- Coverage 87.70% 87.59% -0.11%
==========================================
Files 197 197
Lines 13327 13338 +11
==========================================
- Hits 11689 11684 -5
- Misses 1638 1654 +16
|
This is ready now. |
I noticed this new property thanks to [this tweet](https://twitter.com/ariskox/status/1658067009609904129?s=61&t=Zz639sMJdwHISm4AKYXoCw). This changes the "future" implementation of `SK2StoreProduct.currencyCode` to use [the new (backdeployed) property](https://developer.apple.com/documentation/storekit/product/4044347-priceformatstyle). We still need the existing implementation because `@_backDeploy` won't work if compiling with `Xcode 13.x`.
I noticed this new property thanks to this tweet.
This changes the "future" implementation of
SK2StoreProduct.currencyCode
to use the new (backdeployed) property.We still need the existing implementation because
@_backDeploy
won't work if compiling withXcode 13.x
.