Small Settings QOL improvements

This commit is contained in:
James Magahern
2023-04-19 14:30:06 -07:00
parent 6a187b0df3
commit 98dfd85781
2 changed files with 60 additions and 5 deletions

View File

@@ -229,13 +229,19 @@ class CreateRedirectRuleViewController: UICollectionViewController
sectionHeaderImageView.contentMode = .scaleAspectFit
fromHostField.placeholder = "https://fromhostname.com"
fromHostField.placeholder = "fromhostname.com"
fromHostField.autocorrectionType = .no
fromHostField.autocapitalizationType = .none
fromHostField.keyboardType = .URL
fromHostField.returnKeyType = .next
fromHostField.delegate = self
toHostField.placeholder = "https://tohostname.com"
toHostField.placeholder = "tohostname.com"
toHostField.autocorrectionType = .no
toHostField.autocapitalizationType = .none
toHostField.keyboardType = .URL
toHostField.returnKeyType = .done
toHostField.delegate = self
}
required init?(coder: NSCoder) {
@@ -256,3 +262,15 @@ class CreateRedirectRuleViewController: UICollectionViewController
}
}
extension CreateRedirectRuleViewController : UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField == fromHostField {
toHostField.becomeFirstResponder()
} else if textField == toHostField {
toHostField.resignFirstResponder()
}
return false
}
}