Closed mlchild closed 7 years ago
HI @mlchild, thanks for the idea. This one should be easy. We can do it for the next release. Do you maybe have time to help out with this?
Sure, I think could just add:
public func becomeFirstResponder() { textField.becomeFirstResponder() }
after the show/hide/add functions in CDAlertView.swift at line 320 (not sure how to do pull request, ha).
Could also do this one for symmetry:
public func resignFirstResponder() { textField.resignFirstResponder() }
It's better to check with isTextFieldHidden
property. If it is hidden, we don't need to interrupt current responder chain. So I would suggest that
public func becomeFirstResponder() {
if !isTextFieldHidden {
textField.becomeFirstResponder()
}
}
same for resigning.
To do a PR, you should fork the repository first. This process will clone this repository to your account with saving connection to this one. Than you do your changes in forked repository (the one in your account). And from there, you will see New Pull Request
button next to branch list. After pressing that, GitHub'll show you this repository and master
branch as a base fork
. And you only need to press Create Pull Request
button in there :)
This is an awesome library, thanks for doing it. It would be a cool enhancement if I could make the textField firstResponder so that the user could start typing immediately.