diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-11-24 14:08:10 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-11-26 14:04:17 +0100 |
| commit | 55914bd80cc80d9adbbe29d536963cb8fb67893c (patch) | |
| tree | 4cea8db7669093091c82495938fa407304ff625b | |
| parent | dbbb50742ae8068209889346496bb90029a78e1c (diff) | |
| download | mullvadvpn-55914bd80cc80d9adbbe29d536963cb8fb67893c.tar.xz mullvadvpn-55914bd80cc80d9adbbe29d536963cb8fb67893c.zip | |
AccountTextField: inherit from CustomTextField
| -rw-r--r-- | ios/MullvadVPN/AccountInputGroupView.swift | 5 | ||||
| -rw-r--r-- | ios/MullvadVPN/AccountTextField.swift | 13 |
2 files changed, 5 insertions, 13 deletions
diff --git a/ios/MullvadVPN/AccountInputGroupView.swift b/ios/MullvadVPN/AccountInputGroupView.swift index 9ca166d383..e99f1ae18e 100644 --- a/ios/MullvadVPN/AccountInputGroupView.swift +++ b/ios/MullvadVPN/AccountInputGroupView.swift @@ -47,9 +47,8 @@ class AccountInputGroupView: UIView { let textField = AccountTextField() textField.font = UIFont.systemFont(ofSize: 20) textField.translatesAutoresizingMaskIntoConstraints = false - textField.attributedPlaceholder = NSAttributedString( - string: "0000 0000 0000 0000", - attributes: [.foregroundColor: UIColor.lightGray]) + textField.placeholder = "0000 0000 0000 0000" + textField.placeholderTextColor = .lightGray textField.textContentType = .username textField.clearButtonMode = .never textField.autocapitalizationType = .none diff --git a/ios/MullvadVPN/AccountTextField.swift b/ios/MullvadVPN/AccountTextField.swift index 7a1d00dc5d..6973edb1fc 100644 --- a/ios/MullvadVPN/AccountTextField.swift +++ b/ios/MullvadVPN/AccountTextField.swift @@ -8,7 +8,7 @@ import UIKit -class AccountTextField: UITextField, UITextFieldDelegate { +class AccountTextField: CustomTextField, UITextFieldDelegate { private let input = AccountTokenInput() @@ -17,7 +17,8 @@ class AccountTextField: UITextField, UITextFieldDelegate { override init(frame: CGRect) { super.init(frame: frame) - backgroundColor = UIColor.clear + backgroundColor = .clear + cornerRadius = 0 delegate = self pasteDelegate = input @@ -54,14 +55,6 @@ class AccountTextField: UITextField, UITextFieldDelegate { } } - override func textRect(forBounds bounds: CGRect) -> CGRect { - return bounds.insetBy(dx: 14, dy: 12) - } - - override func editingRect(forBounds bounds: CGRect) -> CGRect { - return textRect(forBounds: bounds) - } - // MARK: - UITextFieldDelegate func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { |
