aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-21 23:34:56 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-21 23:34:56 +0100
commit7b9d4cb9e35a88f13face71543ce4773102fe224 (patch)
tree90810e67570a1bd2b520f352b50117925d3b1fab /WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift
parentproviderConfiguration is now a WgQuickConfig (diff)
downloadwireguard-apple-7b9d4cb9e35a88f13face71543ce4773102fe224.tar.xz
wireguard-apple-7b9d4cb9e35a88f13face71543ce4773102fe224.zip
Nuke trailing spaces
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift16
1 files changed, 8 insertions, 8 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift b/WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift
index aff17ee..5d9ab92 100644
--- a/WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift
+++ b/WireGuard/WireGuard/UI/iOS/View/ButtonCell.swift
@@ -13,20 +13,20 @@ class ButtonCell: UITableViewCell {
set(value) { button.tintColor = value ? .red : buttonStandardTintColor }
}
var onTapped: (() -> Void)?
-
+
let button: UIButton = {
let button = UIButton(type: .system)
button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .body)
button.titleLabel?.adjustsFontForContentSizeCategory = true
return button
}()
-
+
var buttonStandardTintColor: UIColor
-
+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
buttonStandardTintColor = button.tintColor
super.init(style: style, reuseIdentifier: reuseIdentifier)
-
+
contentView.addSubview(button)
button.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
@@ -34,18 +34,18 @@ class ButtonCell: UITableViewCell {
contentView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: button.bottomAnchor),
button.centerXAnchor.constraint(equalTo: contentView.centerXAnchor)
])
-
+
button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
}
-
+
@objc func buttonTapped() {
onTapped?()
}
-
+
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
-
+
override func prepareForReuse() {
super.prepareForReuse()
buttonText = ""