The code is:
open func addTextField(_ configuration: (_ textField: UITextField?) -> ()) {
let textField = EMAlertTextField()
textField.delegate = self
configuration(textField)
addTextField(textField)
}
EMAlertTextField.init is not optional constructor. So textField guaranteed to be non-optional.
There's no way call like configuration(nil) ever happen.
So why does it still declared as configuration: (_ textField: UITextField?) -> ()?