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/UI/BalanceTitleView.swift

46 lines
1.1 KiB

// Copyright SIX DAY LLC. All rights reserved.
7 years ago
import UIKit
class BalanceTitleView: UIView {
/// UIAppearance compatible property
dynamic var titleColor: UIColor {
get { return self.label.textColor! }
7 years ago
set { self.label.textColor = newValue }
}
dynamic var titleFont: UIFont {
get { return self.label.font! }
set { self.label.font = newValue }
}
7 years ago
let label: UILabel = UILabel()
7 years ago
var title: String = "" {
didSet {
label.text = title
label.sizeToFit()
}
}
7 years ago
override init(frame: CGRect) {
super.init(frame: .zero)
label.translatesAutoresizingMaskIntoConstraints = false
7 years ago
addSubview(label)
7 years ago
NSLayoutConstraint.activate([
label.trailingAnchor.constraint(equalTo: trailingAnchor),
label.leadingAnchor.constraint(equalTo: leadingAnchor),
label.topAnchor.constraint(equalTo: topAnchor),
label.bottomAnchor.constraint(equalTo: bottomAnchor),
])
}
7 years ago
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}