Files
eqn.ios/Sources/Earthquake Network/Controllers/InApp/SubscriptionsHeaderTableViewCell.swift
T

40 lines
866 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: UITableViewCell {
var isLoading = false {
didSet {
updateUI()
}
}
var title: String? = nil {
didSet {
updateUI()
}
}
@IBOutlet private weak var headerTitleLabel: UILabel!
@IBOutlet private weak var loadingActivityIndicator: UIActivityIndicatorView!
// MARK: - Private
private func updateUI() {
headerTitleLabel.text = title
if isLoading && title != nil {
loadingActivityIndicator.startAnimating()
} else {
loadingActivityIndicator.stopAnimating()
}
}
}