tokenary/Tokenary iOS/Screens/Accounts/AccountTableViewCell.swift

29 lines
800 B
Swift
Raw Normal View History

2021-12-09 15:59:47 +03:00
// Copyright © 2021 Tokenary. All rights reserved.
import UIKit
import BlockiesSwift
2021-12-09 16:25:30 +03:00
protocol AccountTableViewCellDelegate: AnyObject {
func didTapMoreButton(accountCell: AccountTableViewCell)
}
2021-12-09 15:59:47 +03:00
class AccountTableViewCell: UITableViewCell {
2021-12-09 16:25:30 +03:00
private weak var cellDelegate: AccountTableViewCellDelegate?
2021-12-09 15:59:47 +03:00
@IBOutlet weak var avatarImageView: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
2021-12-09 16:25:30 +03:00
func setup(address: String, delegate: AccountTableViewCellDelegate) {
cellDelegate = delegate
2021-12-09 15:59:47 +03:00
avatarImageView.image = Blockies(seed: address.lowercased()).createImage()
2021-12-13 16:57:02 +03:00
titleLabel.text = address.trimmedAddress
2021-12-09 15:59:47 +03:00
}
2021-12-09 16:25:30 +03:00
@IBAction func moreButtonTapped(_ sender: Any) {
cellDelegate?.didTapMoreButton(accountCell: self)
}
2021-12-09 15:59:47 +03:00
}