blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
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.
36 lines
1.0 KiB
36 lines
1.0 KiB
// Copyright SIX DAY LLC. All rights reserved.
|
|
|
|
import UIKit
|
|
|
|
protocol EditTokenTableViewCellDelegate: class {
|
|
func didChangeState(state: Bool, in cell: EditTokenTableViewCell)
|
|
}
|
|
|
|
class EditTokenTableViewCell: UITableViewCell {
|
|
|
|
@IBOutlet weak var tokenImageView: UIImageView!
|
|
@IBOutlet weak var tokenLabel: UILabel!
|
|
@IBOutlet weak var tokenEnableSwitch: UISwitch!
|
|
weak var delegate: EditTokenTableViewCellDelegate?
|
|
|
|
var viewModel: EditTokenTableCellViewModel? {
|
|
didSet {
|
|
tokenImageView.image = viewModel?.image
|
|
tokenLabel.text = viewModel?.title
|
|
tokenEnableSwitch.isOn = viewModel?.isEnabled ?? false
|
|
}
|
|
}
|
|
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
// Initialization code
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
}
|
|
|
|
@IBAction func didChangeSwitch(_ sender: UISwitch) {
|
|
delegate?.didChangeState(state: sender.isOn, in: self)
|
|
}
|
|
}
|
|
|