refactor: Recreate controllers for subscriptions

This commit is contained in:
Andrea Busi
2020-07-30 07:24:48 +02:00
parent ccfd56d4d0
commit f63a9b44fc
21 changed files with 955 additions and 392 deletions
@@ -0,0 +1,41 @@
//
// SubscriptionsActiveTableViewCell.swift
// Earthquake Network
//
// Created by Busi Andrea on 30/07/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import UIKit
class SubscriptionsActiveTableViewCell: EQNBaseTableViewCell {
var product: SKProduct? {
didSet {
updateUI()
}
}
@IBOutlet private weak var noSubscriptionsLabel: UILabel!
@IBOutlet private weak var activeSubscriptionImageView: UIImageView!
// MARK: - View Lifecycle
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
// MARK: - Private
private func updateUI() {
if let productIdentifier = product?.productIdentifier {
noSubscriptionsLabel.isHidden = true
activeSubscriptionImageView.isHidden = false
activeSubscriptionImageView.image = imageForProductIdentifier(productIdentifier)
} else {
noSubscriptionsLabel.isHidden = false
activeSubscriptionImageView.isHidden = true
}
}
}