I'm trying to add functionality to my ResponsiveTextField that normally would be exposed through a UITextFieldDelegate, such as preventing a UITextField from dismissing.
final class AlwaysDisplayingTextFieldDelegate: NSObject, UITextFieldDelegate {
func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
false
}
}
My initial approach was to try creating a delegate and setting that delegate within the configuration. (Note: that leads to a correct warning Instance will be immediately deallocated because property 'delegate' is 'weak'.)
static var `default`: Self {
ResponsiveTextField.Configuration(configure: {
$0.autocapitalizationType = .none
$0.autocorrectionType = .no
$0.delegate = AlwaysDisplayingTextFieldDelegate()
})
}
Is there any way to add functionality to a ResponsiveTextField through the delegate, or to prevent a keyboard from ever dismissing that I may be overlooking?
I'm trying to add functionality to my ResponsiveTextField that normally would be exposed through a
UITextFieldDelegate, such as preventing a UITextField from dismissing.My initial approach was to try creating a delegate and setting that delegate within the configuration. (Note: that leads to a correct warning
Instance will be immediately deallocated because property 'delegate' is 'weak'.)Is there any way to add functionality to a ResponsiveTextField through the delegate, or to prevent a keyboard from ever dismissing that I may be overlooking?