From ebb486b6deeb6c7b657137f22131aae08a362dea Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 9 Nov 2019 17:56:35 +0100 Subject: [PATCH] Move price out of product title --- Passepartout-iOS/Base.lproj/Purchase.storyboard | 13 +++++++++++-- .../Scenes/Purchase/PurchaseTableViewCell.swift | 11 ++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Passepartout-iOS/Base.lproj/Purchase.storyboard b/Passepartout-iOS/Base.lproj/Purchase.storyboard index 25c6705b..f969ca83 100644 --- a/Passepartout-iOS/Base.lproj/Purchase.storyboard +++ b/Passepartout-iOS/Base.lproj/Purchase.storyboard @@ -43,7 +43,13 @@ + @@ -75,6 +83,7 @@ + diff --git a/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift b/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift index 8efbab02..d6bb9a06 100644 --- a/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift +++ b/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift @@ -29,27 +29,28 @@ import StoreKit class PurchaseTableViewCell: UITableViewCell { @IBOutlet private weak var labelTitle: UILabel? + @IBOutlet private weak var labelPrice: UILabel? + @IBOutlet private weak var labelDescription: UILabel? override func awakeFromNib() { super.awakeFromNib() labelTitle?.applyAccent(.current) + labelPrice?.applyAccent(.current) } func fill(product: SKProduct) { - var title = product.localizedTitle - if let price = product.localizedPrice { - title += " @ \(price)" - } fill( - title: title, + title: product.localizedTitle, description: "\(product.localizedDescription)." ) + labelPrice?.text = product.localizedPrice } func fill(title: String, description: String) { labelTitle?.text = title labelDescription?.text = description + labelPrice?.text = nil } }