tokenary/Encrypted Ink/Views/AccountCellView.swift
2021-06-13 04:41:04 +03:00

24 lines
696 B
Swift

// Copyright © 2021 Encrypted Ink. All rights reserved.
import Cocoa
import BlockiesSwift
class AccountCellView: NSTableRowView {
@IBOutlet weak var addressImageView: NSImageView! {
didSet {
addressImageView.wantsLayer = true
addressImageView.layer?.cornerRadius = 15
addressImageView.layer?.masksToBounds = true
}
}
@IBOutlet weak var addressTextField: NSTextField!
func setup(address: String) {
addressImageView.image = Blockies(seed: address).createImage()
let without0x = address.dropFirst(2)
addressTextField.stringValue = without0x.prefix(4) + "..." + without0x.suffix(4)
}
}