Small Settings QOL improvements
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user