Add important clarifications below paid products

This commit is contained in:
Davide De Rosa 2019-11-09 13:51:52 +01:00
parent 63bd33aa4e
commit 7510839804
4 changed files with 34 additions and 4 deletions

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="fEC-GT-W4O">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="fEC-GT-W4O">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@ -27,12 +27,13 @@
<scene sceneID="93l-dg-vRI">
<objects>
<tableViewController id="bQc-2A-qWz" customClass="PurchaseViewController" customModule="Passepartout" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="5WE-4Q-uDQ">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="5WE-4Q-uDQ">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="PurchaseTableViewCell" id="0XE-hK-4Ro" customClass="PurchaseTableViewCell" customModule="Passepartout" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="414" height="105"/>
<rect key="frame" x="0.0" y="55.5" width="414" height="105"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="0XE-hK-4Ro" id="Fe6-eH-sBT">
<rect key="frame" x="0.0" y="0.0" width="414" height="105"/>

View File

@ -89,6 +89,14 @@ internal enum L10n {
internal static let title = L10n.tr("App", "purchase.cells.restore.title")
}
}
internal enum Sections {
internal enum Products {
/// Every product is a one-time purchase.\n\n%@ entails:\n\n- All providers (including those being added in the future)\n%@
internal static func footer(_ p1: String, _ p2: String) -> String {
return L10n.tr("App", "purchase.sections.products.footer", p1, p2)
}
}
}
}
internal enum Service {
internal enum Alerts {

View File

@ -61,5 +61,6 @@
"shortcuts.edit.cells.add_shortcut.caption" = "Add shortcut";
"purchase.title" = "Purchase";
"purchase.sections.products.footer" = "Every product is a one-time purchase.\n\n%@ entails:\n\n- All providers (including those being added in the future)\n%@";
"purchase.cells.restore.title" = "Restore purchases";
"purchase.cells.restore.description" = "If you bought this app or feature in the past, you can restore your purchases and this screen won't show again.";

View File

@ -44,6 +44,8 @@ class PurchaseViewController: UITableViewController, StrongTableHost {
var model: StrongTableModel<SectionType, RowType> = StrongTableModel()
func reloadModel() {
let fullVersionString: String
model.clear()
model.add(.products)
@ -56,9 +58,19 @@ class PurchaseViewController: UITableViewController, StrongTableHost {
if let skFullVersion = pm.product(withIdentifier: .fullVersion) {
self.skFullVersion = skFullVersion
rows.append(.fullVersion)
fullVersionString = skFullVersion.localizedTitle
} else {
fullVersionString = "Full version" // XXX
}
rows.append(.restore)
model.set(rows, forSection: .products)
let featureBulletsList: [String] = ProductManager.shared.featureProducts(includingFullVersion: false).map {
return "- \($0.localizedTitle)"
}.sortedCaseInsensitive()
let featureBullets = featureBulletsList.joined(separator: "\n")
model.setFooter(L10n.App.Purchase.Sections.Products.footer(fullVersionString, featureBullets), forSection: .products)
}
// MARK: UIViewController
@ -156,6 +168,14 @@ extension PurchaseViewController {
case restore
}
override func numberOfSections(in tableView: UITableView) -> Int {
return model.numberOfSections
}
override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
return model.footer(forSection: section)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard !isLoading else {
return 0