From 96a5956a28867b838162cca334b8afde70b9bb91 Mon Sep 17 00:00:00 2001 From: Andrea Bizzotto Date: Wed, 20 Dec 2017 09:55:59 +0000 Subject: [PATCH 1/3] Remove localizedIntroductoryPrice, introductoryPrice --- SwiftyStoreKit/SKProduct+LocalizedPrice.swift | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/SwiftyStoreKit/SKProduct+LocalizedPrice.swift b/SwiftyStoreKit/SKProduct+LocalizedPrice.swift index 41778074..f6ebb498 100644 --- a/SwiftyStoreKit/SKProduct+LocalizedPrice.swift +++ b/SwiftyStoreKit/SKProduct+LocalizedPrice.swift @@ -28,21 +28,13 @@ import StoreKit public extension SKProduct { public var localizedPrice: String? { - return formattedPrice(price: price, locale: priceLocale) + return priceFormatter(locale: priceLocale).string(from: price) } - - @available(iOS 11.2, OSX 10.13.2, tvOS 11.2, *) - public var localizedIntroductoryPrice: String? { - guard let introductoryPrice = introductoryPrice else { - return nil - } - return formattedPrice(price: introductoryPrice.price, locale: introductoryPrice.priceLocale) - } - - private func formattedPrice(price: NSDecimalNumber, locale: Locale) -> String? { - let numberFormatter = NumberFormatter() - numberFormatter.locale = locale - numberFormatter.numberStyle = .currency - return numberFormatter.string(from: price) + + private func priceFormatter(locale: Locale) -> NumberFormatter { + let formatter = NumberFormatter() + formatter.locale = locale + formatter.numberStyle = .currency + return formatter } } From 716af4a1f9714b0632d3bf5ca60882ebbb1201f1 Mon Sep 17 00:00:00 2001 From: Andrea Bizzotto Date: Wed, 20 Dec 2017 10:02:42 +0000 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 958fcf0f..258c6835 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [0.11.2](https://github.com/bizz84/SwiftyStoreKit/releases/tag/0.11.2) Remove `SKProduct.localizedIntroductoryPrice` + +* Remove `localizedIntroductoryPrice` ([#320](https://github.com/bizz84/SwiftyStoreKit/pull/320/files), see [#319](https://github.com/bizz84/SwiftyStoreKit/issues/319), [#318](https://github.com/bizz84/SwiftyStoreKit/pull/318), [#315](https://github.com/bizz84/SwiftyStoreKit/pull/315)) + ## [0.11.1](https://github.com/bizz84/SwiftyStoreKit/releases/tag/0.11.1) Add `PaymentTransaction.transactionDate` and `SKProduct.localizedIntroductoryPrice` * Add `transactionDate` to `PaymentTransaction` ([#316](https://github.com/bizz84/SwiftyStoreKit/pull/316), see [#312](https://github.com/bizz84/SwiftyStoreKit/issues/312)). From 423d2ea943d6c0fbf7a7aec7adfda1a9d44c4bb7 Mon Sep 17 00:00:00 2001 From: Andrea Bizzotto Date: Wed, 20 Dec 2017 10:40:07 +0000 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 258c6835..67b06a10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. ## [0.11.2](https://github.com/bizz84/SwiftyStoreKit/releases/tag/0.11.2) Remove `SKProduct.localizedIntroductoryPrice` -* Remove `localizedIntroductoryPrice` ([#320](https://github.com/bizz84/SwiftyStoreKit/pull/320/files), see [#319](https://github.com/bizz84/SwiftyStoreKit/issues/319), [#318](https://github.com/bizz84/SwiftyStoreKit/pull/318), [#315](https://github.com/bizz84/SwiftyStoreKit/pull/315)) +* Remove `localizedIntroductoryPrice` ([#320](https://github.com/bizz84/SwiftyStoreKit/pull/320), see [#319](https://github.com/bizz84/SwiftyStoreKit/issues/319), [#318](https://github.com/bizz84/SwiftyStoreKit/pull/318), [#315](https://github.com/bizz84/SwiftyStoreKit/pull/315)) ## [0.11.1](https://github.com/bizz84/SwiftyStoreKit/releases/tag/0.11.1) Add `PaymentTransaction.transactionDate` and `SKProduct.localizedIntroductoryPrice`