An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/Trust/Accounts/Views/AccountViewCell.swift

40 lines
1.3 KiB

// Copyright SIX DAY LLC. All rights reserved.
import TrustKeystore
import UIKit
protocol AccountViewCellDelegate: class {
func accountViewCell(_ cell: AccountViewCell, didTapInfoViewForAccount _: Wallet)
}
class AccountViewCell: UITableViewCell {
@IBOutlet weak var infoButton: UIButton!
@IBOutlet weak var activeView: UIView!
@IBOutlet weak var glassesImageView: UIImageView!
@IBOutlet weak var walletTypeImageView: UIImageView!
@IBOutlet weak var addressLable: UILabel!
@IBOutlet weak var balanceLable: UILabel!
weak var delegate: AccountViewCellDelegate?
var viewModel: AccountViewModel? {
didSet {
guard let model = viewModel else {
return
}
balanceLable.text = "\(model.balance) ETH"
glassesImageView.isHidden = !model.isWatch
activeView.isHidden = !model.isActive
addressLable.text = model.title
infoButton.tintColor = Colors.lightBlue
}
}
override func prepareForReuse() {
super.prepareForReuse()
self.viewModel = nil
}
@IBAction func infoAction(_ sender: Any) {
guard let account = viewModel?.wallet else {
return
}
delegate?.accountViewCell(self, didTapInfoViewForAccount: account)
}
}