Эх сурвалжийг харах

add continue keyboard button to 'Name' text field in ProfileInfoViewController, which appears in QR-Code account setup

cyberta 4 жил өмнө
parent
commit
84fadf67ab

+ 10 - 1
deltachat-ios/Controller/ProfileInfoViewController.swift

@@ -28,12 +28,13 @@ class ProfileInfoViewController: UITableViewController {
     }()
 
     private lazy var nameCell: TextFieldCell = {
-        let cell =  TextFieldCell.makeNameCell()
+        let cell =  TextFieldCell.makeNameCell(delegate: self)
         cell.placeholder = String.localized("pref_your_name")
         cell.setText(text: dcContext.displayname)
         cell.onTextFieldChange = {[weak self] textField in
             self?.displayName = textField.text
         }
+        cell.textField.returnKeyType = .continue
         return cell
     }()
 
@@ -147,3 +148,11 @@ extension ProfileInfoViewController: MediaPickerDelegate {
         updateAvatarCell()
     }
 }
+
+extension ProfileInfoViewController: UITextFieldDelegate {
+
+    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
+        textField.resignFirstResponder()
+        return true
+    }
+}