diff options
author | Eric Kuck <eric@bluelinelabs.com> | 2018-12-14 17:12:59 -0600 |
---|---|---|
committer | Eric Kuck <eric@bluelinelabs.com> | 2018-12-14 17:15:22 -0600 |
commit | 7a24f18eb753180800f9b44a767b0d59e4e702b7 (patch) | |
tree | 0e02b3ff59a672b0b25eb7bcc195e23730abec40 /WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditKeyValueCell.swift | |
parent | Prettier log time format (diff) | |
download | wireguard-apple-7a24f18eb753180800f9b44a767b0d59e4e702b7.tar.xz wireguard-apple-7a24f18eb753180800f9b44a767b0d59e4e702b7.zip |
Most similar views now shared between ViewControllers
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/SharedViews/EditableKeyValueCell.swift (renamed from WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditKeyValueCell.swift) | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditKeyValueCell.swift b/WireGuard/WireGuard/UI/iOS/SharedViews/EditableKeyValueCell.swift index 432d75b..48956eb 100644 --- a/WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditKeyValueCell.swift +++ b/WireGuard/WireGuard/UI/iOS/SharedViews/EditableKeyValueCell.swift @@ -3,10 +3,10 @@ import UIKit -class TunnelEditKeyValueCell: UITableViewCell { +class EditableKeyValueCell: UITableViewCell { var key: String { get { return keyLabel.text ?? "" } - set(value) {keyLabel.text = value } + set(value) { keyLabel.text = value } } var value: String { get { return valueTextField.text ?? "" } @@ -89,7 +89,7 @@ class TunnelEditKeyValueCell: UITableViewCell { func configureForContentSize() { var constraints = [NSLayoutConstraint]() - if self.traitCollection.preferredContentSizeCategory.isAccessibilityCategory { + if traitCollection.preferredContentSizeCategory.isAccessibilityCategory { // Stack vertically if !isStackedVertically { constraints = [ @@ -113,9 +113,9 @@ class TunnelEditKeyValueCell: UITableViewCell { } } if !constraints.isEmpty { - NSLayoutConstraint.deactivate(self.contentSizeBasedConstraints) + NSLayoutConstraint.deactivate(contentSizeBasedConstraints) NSLayoutConstraint.activate(constraints) - self.contentSizeBasedConstraints = constraints + contentSizeBasedConstraints = constraints } } @@ -136,7 +136,7 @@ class TunnelEditKeyValueCell: UITableViewCell { } } -extension TunnelEditKeyValueCell: UITextFieldDelegate { +extension EditableKeyValueCell: UITextFieldDelegate { func textFieldDidBeginEditing(_ textField: UITextField) { textFieldValueOnBeginEditing = textField.text ?? "" isValueValid = true |