Dismiss keyboard when text fields are done editing

This commit is contained in:
Phil Viso 2019-05-19 16:17:10 -05:00
parent 9d72fede05
commit 890c146c7e
1 changed files with 11 additions and 0 deletions

View File

@ -34,12 +34,14 @@ class AddFeedViewController: UITableViewController, AddContainerViewControllerCh
urlTextField.autocorrectionType = .no
urlTextField.autocapitalizationType = .none
urlTextField.text = initialFeed
urlTextField.delegate = self
if initialFeed != nil {
delegate?.readyToAdd(state: true)
}
nameTextField.text = initialFeedName
nameTextField.delegate = self
pickerData = AddFeedFolderPickerData()
folderPickerView.dataSource = self
@ -200,3 +202,12 @@ private extension AddFeedViewController {
}
}
extension AddFeedViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}