Show placeholders value for Eth in Wallet tab

pull/99/head
Hwee-Boon Yar 7 years ago
parent 24553624d0
commit 3b12f6e786
  1. 8
      Trust.xcodeproj/project.pbxproj
  2. 46
      Trust/Tokens/ViewControllers/TokensViewController.swift
  3. 111
      Trust/Tokens/ViewModels/EthTokenViewCellViewModel.swift
  4. 50
      Trust/Tokens/ViewModels/TicketTokenViewCellViewModel.swift
  5. 135
      Trust/Tokens/Views/EthTokenViewCell.swift
  6. 58
      Trust/Tokens/Views/TicketTokenViewCell.swift

@ -302,11 +302,13 @@
5E7C7499A8D6814F7950DA70 /* LockCreatePasscodeCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C7AB3440C01136DF4F3E9 /* LockCreatePasscodeCoordinator.swift */; };
5E7C74B99922D0CAB635970E /* PasscodeCharacterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C7B9220E616F82EDA956F /* PasscodeCharacterView.swift */; };
5E7C75C99B9F595F26EDC405 /* LockPasscodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C7D5F3CAE69CF932AB236 /* LockPasscodeViewController.swift */; };
5E7C75D46140FACBD12333BF /* EthTokenViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C7EE374A74F2B00013C18 /* EthTokenViewCell.swift */; };
5E7C75F80A7E178B49830BCD /* TicketsViewControllerHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C796039C0F47CDCA236C0 /* TicketsViewControllerHeader.swift */; };
5E7C760C7D55C97424F55138 /* TicketTableViewCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C75F877B2F2E24C7EF258 /* TicketTableViewCellViewModel.swift */; };
5E7C76A0365D128B7F19A0C2 /* ProtectionCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C74BEC095303B66FB4B1E /* ProtectionCoordinator.swift */; };
5E7C76B917517C93D1E26B0A /* LockEnterPasscodeCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C7981AB6584B25C72D46B /* LockEnterPasscodeCoordinator.swift */; };
5E7C76F8CB67466725C590CE /* TokenViewCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C79ED9F842D3FC102AC54 /* TokenViewCellViewModel.swift */; };
5E7C774B5332AC0DC19C5B1B /* EthTokenViewCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C74B82783A94091A43470 /* EthTokenViewCellViewModel.swift */; };
5E7C7793AB6B577906F2BCA3 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C7AFE9AF9FE6B58C925D4 /* SettingsViewController.swift */; };
5E7C77E844D710D7AFBC58D4 /* RequestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C74DCC21272EC231A20E2 /* RequestViewController.swift */; };
5E7C78407F6DCB0EDD562DF6 /* TicketTokenViewCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E7C731B6F01534683227123 /* TicketTokenViewCellViewModel.swift */; };
@ -764,6 +766,7 @@
5E7C73495E0C0A207152EC25 /* LockEnterPasscodeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LockEnterPasscodeViewController.swift; path = Trust/AlphaWalletLock/ViewControllers/LockEnterPasscodeViewController.swift; sourceTree = SOURCE_ROOT; };
5E7C741196D9D9C9C3EE5E30 /* LockCreatePasscodeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LockCreatePasscodeViewController.swift; sourceTree = "<group>"; };
5E7C74A2C738BF2412D412A7 /* TicketSellInfoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TicketSellInfoViewController.swift; sourceTree = "<group>"; };
5E7C74B82783A94091A43470 /* EthTokenViewCellViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EthTokenViewCellViewModel.swift; sourceTree = "<group>"; };
5E7C74B9EB81C51E956566E7 /* TokensDataStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokensDataStore.swift; sourceTree = "<group>"; };
5E7C74BEC095303B66FB4B1E /* ProtectionCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProtectionCoordinator.swift; sourceTree = "<group>"; };
5E7C74DCC21272EC231A20E2 /* RequestViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestViewController.swift; sourceTree = "<group>"; };
@ -804,6 +807,7 @@
5E7C7D5F3CAE69CF932AB236 /* LockPasscodeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LockPasscodeViewController.swift; sourceTree = "<group>"; };
5E7C7E24936CC2190D2A16C2 /* OnboardingPageViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingPageViewModel.swift; sourceTree = "<group>"; };
5E7C7E2DCCE0D775ECF83088 /* WalletFilter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WalletFilter.swift; path = Models/WalletFilter.swift; sourceTree = "<group>"; };
5E7C7EE374A74F2B00013C18 /* EthTokenViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EthTokenViewCell.swift; sourceTree = "<group>"; };
5E7C7EE467A7F5F2E5B1F660 /* TokensViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokensViewModel.swift; sourceTree = "<group>"; };
5E7C7F932B48011A24C26733 /* TokensCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokensCoordinator.swift; sourceTree = "<group>"; };
613D04881FDE15F8008DE72E /* COMODO ECC Domain Validation Secure Server CA 2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "COMODO ECC Domain Validation Secure Server CA 2.cer"; sourceTree = "<group>"; };
@ -1551,6 +1555,7 @@
5E7C7C077372C3F2A4349FA1 /* TokenViewCell.swift */,
5E7C7C58586099F082973073 /* WalletFilterView.swift */,
5E7C783E3ADA4CF9554A0E7D /* TicketTokenViewCell.swift */,
5E7C7EE374A74F2B00013C18 /* EthTokenViewCell.swift */,
);
path = Views;
sourceTree = "<group>";
@ -1583,6 +1588,7 @@
5E7C731B6F01534683227123 /* TicketTokenViewCellViewModel.swift */,
5E7C7EE467A7F5F2E5B1F660 /* TokensViewModel.swift */,
5E7C75CC640BAFFE0E789F44 /* WalletFilterViewModel.swift */,
5E7C74B82783A94091A43470 /* EthTokenViewCellViewModel.swift */,
);
path = ViewModels;
sourceTree = "<group>";
@ -3340,6 +3346,8 @@
5E7C74B99922D0CAB635970E /* PasscodeCharacterView.swift in Sources */,
5E7C76B917517C93D1E26B0A /* LockEnterPasscodeCoordinator.swift in Sources */,
5E7C76A0365D128B7F19A0C2 /* ProtectionCoordinator.swift in Sources */,
5E7C774B5332AC0DC19C5B1B /* EthTokenViewCellViewModel.swift in Sources */,
5E7C75D46140FACBD12333BF /* EthTokenViewCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

@ -45,6 +45,7 @@ class TokensViewController: UIViewController {
view.addSubview(filterView)
tableView.register(TokenViewCell.self, forCellReuseIdentifier: TokenViewCell.identifier)
tableView.register(EthTokenViewCell.self, forCellReuseIdentifier: EthTokenViewCell.identifier)
tableView.register(TicketTokenViewCell.self, forCellReuseIdentifier: TicketTokenViewCell.identifier)
tableView.translatesAutoresizingMaskIntoConstraints = false
tableView.delegate = self
@ -207,18 +208,33 @@ extension TokensViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let token = viewModel.item(for: indexPath.row, section: indexPath.section)
if token.isStormBird {
let cellViewModel = TicketTokenViewCellViewModel(
//TODO extract getting type of token/config from TokensDatastore class side and instance side
let type: TokenType = {
if token.isStormBird {
return .stormBird
}
return TokensDataStore.etherToken(for: dataStore.config) == token ? .ether : .token
}()
switch type {
case .ether:
let cellViewModel = EthTokenViewCellViewModel(
token: token,
ticker: viewModel.ticker(for: token)
)
return cellViewModel.cellHeight
} else {
case .token:
let cellViewModel = TokenViewCellViewModel(
token: token,
ticker: viewModel.ticker(for: token)
)
return cellViewModel.cellHeight
case .stormBird:
let cellViewModel = TicketTokenViewCellViewModel(
token: token,
ticker: viewModel.ticker(for: token)
)
return cellViewModel.cellHeight
}
}
}
@ -248,8 +264,17 @@ extension TokensViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let token = viewModel.item(for: indexPath.row, section: indexPath.section)
if token.isStormBird {
let cell = tableView.dequeueReusableCell(withIdentifier: TicketTokenViewCell.identifier, for: indexPath) as! TicketTokenViewCell
//TODO extract getting type of token/config from TokensDatastore class side and instance side
let type: TokenType = {
if token.isStormBird {
return .stormBird
}
return TokensDataStore.etherToken(for: dataStore.config) == token ? .ether : .token
}()
switch type {
case .ether:
let cell = tableView.dequeueReusableCell(withIdentifier: EthTokenViewCell.identifier, for: indexPath) as! EthTokenViewCell
cell.configure(
viewModel: .init(
token: token,
@ -257,7 +282,7 @@ extension TokensViewController: UITableViewDataSource {
)
)
return cell
} else {
case .token:
let cell = tableView.dequeueReusableCell(withIdentifier: TokenViewCell.identifier, for: indexPath) as! TokenViewCell
cell.configure(
viewModel: .init(
@ -266,6 +291,15 @@ extension TokensViewController: UITableViewDataSource {
)
)
return cell
case .stormBird:
let cell = tableView.dequeueReusableCell(withIdentifier: TicketTokenViewCell.identifier, for: indexPath) as! TicketTokenViewCell
cell.configure(
viewModel: .init(
token: token,
ticker: viewModel.ticker(for: token)
)
)
return cell
}
}

@ -0,0 +1,111 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Foundation
import UIKit
import BigInt
struct EthTokenViewCellViewModel {
private let shortFormatter = EtherNumberFormatter.short
private let token: TokenObject
let ticker: CoinTicker?
init(
token: TokenObject,
ticker: CoinTicker?
) {
self.token = token
self.ticker = ticker
}
var title: String {
return token.title
}
var amount: String {
return shortFormatter.string(from: BigInt(token.value) ?? BigInt(), decimals: token.decimals)
}
var issuer: String {
return ""
}
var blockChainName: String {
return "Ethereum Blockchain"
}
var backgroundColor: UIColor {
return Colors.appBackground
}
var contentsBackgroundColor: UIColor {
return Colors.appWhite
}
var titleColor: UIColor {
return Colors.appText
}
var subtitleColor: UIColor {
return Colors.appBackground
}
var borderColor: UIColor {
return UIColor(red: 236, green: 236, blue: 236)
}
var titleFont: UIFont {
return Fonts.light(size: 25)!
}
var subtitleFont: UIFont {
return Fonts.semibold(size: 10)!
}
var textColor: UIColor {
return UIColor(red: 155, green: 155, blue: 155)
}
var valuePercentageChangeColor: UIColor {
//TODO must have a different color when depreciate?
return Colors.appHighlightGreen
}
var textValueFont: UIFont {
return Fonts.semibold(size: 15)!
}
var textLabelFont: UIFont {
return Fonts.regular(size: 10)!
}
var valuePercentageChangeValue: String {
//TODO read from model
return "+50%"
}
var valuePercentageChangePeriod: String {
return R.string.localizable.aWalletContentsValuePeriodTitle()
}
var valueChange: String {
//TODO read from model
return "$17,000"
}
var valueChangeName: String {
return R.string.localizable.aWalletContentsValueAppreciationTitle()
}
var value: String {
//TODO read from model
return "$51,000"
}
var valueName: String {
return R.string.localizable.aWalletContentsValueDollarTitle()
}
var cellHeight: CGFloat {
return 196
}
}

@ -58,55 +58,7 @@ struct TicketTokenViewCellViewModel {
return Fonts.semibold(size: 10)!
}
var borderColor: UIColor {
return UIColor(red: 236, green: 236, blue: 236)
}
var textColor: UIColor {
return UIColor(red: 155, green: 155, blue: 155)
}
var valuePercentageChangeColor: UIColor {
//TODO must have a different color when depreciate?
return Colors.appHighlightGreen
}
var textValueFont: UIFont {
return Fonts.semibold(size: 15)!
}
var textLabelFont: UIFont {
return Fonts.regular(size: 10)!
}
var valuePercentageChangeValue: String {
//TODO read from model
return "+50%"
}
var valuePercentageChangePeriod: String {
return R.string.localizable.aWalletContentsValuePeriodTitle()
}
var valueChange: String {
//TODO read from model
return "$17,000"
}
var valueChangeName: String {
return R.string.localizable.aWalletContentsValueAppreciationTitle()
}
var value: String {
//TODO read from model
return "$51,000"
}
var valueName: String {
return R.string.localizable.aWalletContentsValueDollarTitle()
}
var cellHeight: CGFloat {
return 196
return 130
}
}

@ -0,0 +1,135 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Foundation
import UIKit
import Kingfisher
class EthTokenViewCell: UITableViewCell {
static let identifier = "EthTokenViewCell"
let background = UIView()
let titleLabel = UILabel()
let blockchainLabel = UILabel()
let separator = UILabel()
let issuerLabel = UILabel()
let middleBorder = UIView()
let valuePercentageChangeValueLabel = UILabel()
let valuePercentageChangePeriodLabel = UILabel()
let valueChangeLabel = UILabel()
let valueChangeNameLabel = UILabel()
let valueLabel = UILabel()
let valueNameLabel = UILabel()
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(background)
background.translatesAutoresizingMaskIntoConstraints = false
valuePercentageChangeValueLabel.textAlignment = .center
valuePercentageChangePeriodLabel.textAlignment = .center
valueChangeLabel.textAlignment = .center
valueChangeNameLabel.textAlignment = .center
valueLabel.textAlignment = .center
valueNameLabel.textAlignment = .center
let bottomRowStack = UIStackView(arrangedSubviews: [blockchainLabel, separator, issuerLabel])
bottomRowStack.axis = .horizontal
bottomRowStack.spacing = 15
bottomRowStack.distribution = .fill
let footerValuesStack = UIStackView(arrangedSubviews: [valuePercentageChangeValueLabel, valueChangeLabel, valueLabel])
footerValuesStack.axis = .horizontal
footerValuesStack.spacing = 15
footerValuesStack.distribution = .fillEqually
let footerNamesStack = UIStackView(arrangedSubviews: [valuePercentageChangePeriodLabel, valueChangeNameLabel, valueNameLabel])
footerNamesStack.axis = .horizontal
footerNamesStack.spacing = 15
footerNamesStack.distribution = .fillEqually
let footerStackView = UIStackView(arrangedSubviews: [middleBorder, .spacer(height: 14), footerValuesStack, footerNamesStack])
footerStackView.translatesAutoresizingMaskIntoConstraints = false
footerStackView.axis = .vertical
footerStackView.spacing = 0
footerStackView.distribution = .fill
footerValuesStack.setContentHuggingPriority(.defaultLow, for: .horizontal)
let stackView = UIStackView(arrangedSubviews: [titleLabel, bottomRowStack, footerStackView])
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
stackView.spacing = 15
stackView.distribution = .fill
background.addSubview(stackView)
// TODO extract constant. Maybe StyleLayout.sideMargin
let xMargin = CGFloat(7)
let yMargin = CGFloat(20)
NSLayoutConstraint.activate([
stackView.leadingAnchor.constraint(equalTo: background.leadingAnchor, constant: 21),
stackView.trailingAnchor.constraint(equalTo: background.trailingAnchor, constant: -21),
stackView.topAnchor.constraint(equalTo: background.topAnchor, constant: 16),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: background.bottomAnchor, constant: -16),
middleBorder.heightAnchor.constraint(equalToConstant: 1),
background.leadingAnchor.constraint(equalTo: leadingAnchor, constant: xMargin),
background.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -xMargin),
background.topAnchor.constraint(equalTo: topAnchor, constant: yMargin),
background.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -yMargin),
])
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func configure(viewModel: EthTokenViewCellViewModel) {
selectionStyle = .none
backgroundColor = viewModel.backgroundColor
background.backgroundColor = viewModel.contentsBackgroundColor
background.layer.cornerRadius = 20
contentView.backgroundColor = viewModel.backgroundColor
titleLabel.textColor = viewModel.titleColor
titleLabel.font = viewModel.titleFont
titleLabel.text = "\(viewModel.amount) \(viewModel.title)"
blockchainLabel.textColor = viewModel.subtitleColor
blockchainLabel.font = viewModel.subtitleFont
blockchainLabel.text = viewModel.blockChainName
issuerLabel.textColor = viewModel.subtitleColor
issuerLabel.font = viewModel.subtitleFont
issuerLabel.text = viewModel.issuer
separator.textColor = viewModel.subtitleColor
separator.font = viewModel.subtitleFont
separator.text = ""
middleBorder.backgroundColor = viewModel.borderColor
valuePercentageChangePeriodLabel.textColor = viewModel.textColor
valuePercentageChangePeriodLabel.font = viewModel.textLabelFont
valuePercentageChangePeriodLabel.text = viewModel.valuePercentageChangePeriod
valueChangeNameLabel.textColor = viewModel.textColor
valueChangeNameLabel.font = viewModel.textLabelFont
valueChangeNameLabel.text = viewModel.valueChangeName
valueNameLabel.textColor = viewModel.textColor
valueNameLabel.font = viewModel.textLabelFont
valueNameLabel.text = viewModel.valueName
valuePercentageChangeValueLabel.textColor = viewModel.valuePercentageChangeColor
valuePercentageChangeValueLabel.font = viewModel.textValueFont
valuePercentageChangeValueLabel.text = viewModel.valuePercentageChangeValue
valueChangeLabel.textColor = viewModel.textColor
valueChangeLabel.font = viewModel.textValueFont
valueChangeLabel.text = viewModel.valueChange
valueLabel.textColor = viewModel.textColor
valueLabel.font = viewModel.textValueFont
valueLabel.text = viewModel.value
}
}

@ -13,50 +13,18 @@ class TicketTokenViewCell: UITableViewCell {
let separator = UILabel()
let issuerLabel = UILabel()
let middleBorder = UIView()
let valuePercentageChangeValueLabel = UILabel()
let valuePercentageChangePeriodLabel = UILabel()
let valueChangeLabel = UILabel()
let valueChangeNameLabel = UILabel()
let valueLabel = UILabel()
let valueNameLabel = UILabel()
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(background)
background.translatesAutoresizingMaskIntoConstraints = false
valuePercentageChangeValueLabel.textAlignment = .center
valuePercentageChangePeriodLabel.textAlignment = .center
valueChangeLabel.textAlignment = .center
valueChangeNameLabel.textAlignment = .center
valueLabel.textAlignment = .center
valueNameLabel.textAlignment = .center
let bottomRowStack = UIStackView(arrangedSubviews: [blockchainLabel, separator, issuerLabel])
bottomRowStack.axis = .horizontal
bottomRowStack.spacing = 15
bottomRowStack.distribution = .fill
let footerValuesStack = UIStackView(arrangedSubviews: [valuePercentageChangeValueLabel, valueChangeLabel, valueLabel])
footerValuesStack.axis = .horizontal
footerValuesStack.spacing = 15
footerValuesStack.distribution = .fillEqually
let footerNamesStack = UIStackView(arrangedSubviews: [valuePercentageChangePeriodLabel, valueChangeNameLabel, valueNameLabel])
footerNamesStack.axis = .horizontal
footerNamesStack.spacing = 15
footerNamesStack.distribution = .fillEqually
let footerStackView = UIStackView(arrangedSubviews: [middleBorder, .spacer(height: 14), footerValuesStack, footerNamesStack])
footerStackView.translatesAutoresizingMaskIntoConstraints = false
footerStackView.axis = .vertical
footerStackView.spacing = 0
footerStackView.distribution = .fill
footerValuesStack.setContentHuggingPriority(.defaultLow, for: .horizontal)
let stackView = UIStackView(arrangedSubviews: [titleLabel, bottomRowStack, footerStackView])
let stackView = UIStackView(arrangedSubviews: [titleLabel, bottomRowStack])
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
stackView.spacing = 15
@ -72,8 +40,6 @@ class TicketTokenViewCell: UITableViewCell {
stackView.topAnchor.constraint(equalTo: background.topAnchor, constant: 16),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: background.bottomAnchor, constant: -16),
middleBorder.heightAnchor.constraint(equalToConstant: 1),
background.leadingAnchor.constraint(equalTo: leadingAnchor, constant: xMargin),
background.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -xMargin),
background.topAnchor.constraint(equalTo: topAnchor, constant: yMargin),
@ -109,27 +75,5 @@ class TicketTokenViewCell: UITableViewCell {
separator.textColor = viewModel.subtitleColor
separator.font = viewModel.subtitleFont
separator.text = "|"
middleBorder.backgroundColor = viewModel.borderColor
valuePercentageChangePeriodLabel.textColor = viewModel.textColor
valuePercentageChangePeriodLabel.font = viewModel.textLabelFont
valuePercentageChangePeriodLabel.text = viewModel.valuePercentageChangePeriod
valueChangeNameLabel.textColor = viewModel.textColor
valueChangeNameLabel.font = viewModel.textLabelFont
valueChangeNameLabel.text = viewModel.valueChangeName
valueNameLabel.textColor = viewModel.textColor
valueNameLabel.font = viewModel.textLabelFont
valueNameLabel.text = viewModel.valueName
valuePercentageChangeValueLabel.textColor = viewModel.valuePercentageChangeColor
valuePercentageChangeValueLabel.font = viewModel.textValueFont
valuePercentageChangeValueLabel.text = viewModel.valuePercentageChangeValue
valueChangeLabel.textColor = viewModel.textColor
valueChangeLabel.font = viewModel.textValueFont
valueChangeLabel.text = viewModel.valueChange
valueLabel.textColor = viewModel.textColor
valueLabel.font = viewModel.textValueFont
valueLabel.text = viewModel.value
}
}

Loading…
Cancel
Save