Files
eqn.ios/Sources/Earthquake Network/Controllers/InApp/SubscriptionsHeaderTableViewCell.swift
T
2020-07-30 21:09:04 +02:00

47 lines
1012 B
Swift

//
// SubscriptionsHeaderTableViewCell.swift
// Earthquake Network
//
// Created by Busi Andrea on 29/07/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
import UIKit
class SubscriptionsHeaderTableViewCell: EQNBaseTableViewCell {
var isLoading = false {
didSet {
updateUI()
}
}
var title: String? = nil {
didSet {
updateUI()
}
}
@IBOutlet private weak var headerTitleLabel: UILabel!
@IBOutlet private weak var loadingActivityIndicator: UIActivityIndicatorView!
// MARK: - View Lifecycle
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
// MARK: - Private
private func updateUI() {
headerTitleLabel.text = title
if isLoading && title != nil {
loadingActivityIndicator.startAnimating()
} else {
loadingActivityIndicator.stopAnimating()
}
}
}