RedMadRobot / input-mask-ios

User input masking library repo.
MIT License
578 stars 96 forks source link

Make TextInputDelegate implementation open #75

Closed AlexisQapa closed 5 years ago

AlexisQapa commented 5 years ago

Prerequisites

Summary

Using MaskedTextInputListener on iOS 11, I can't override shouldChangeCharactersIn as I did for MaskedTextFieldsDelegate before. This method is marked public but not open.

Motivation

In the known issues in the README you recommend overriding shouldChangeCharactersIn but this is not possible with MaskedTextInputListener.

Describe the solution you'd like

Despite I use only shouldChangeCharactersIn, mark both methods for textfields and textviews open so in case anyone needs it.

Describe alternatives you've considered

For now I'm sticking with MaskedTextFieldsDelegate

taflanidi commented 5 years ago

Hey @AlexisQapa,

For a quick check, have you tried overriding this one?

open func textInput(
    _ textInput: UITextInput,
    isChangingCharactersIn range: NSRange,
    replacementString string: String
) -> Mask.Result

textField (_:shouldChangeCharactersIn:replacementString:) and textView(_: shouldChangeTextIn:replacementString:) had been made non-open on purpose, you shouldn't really alter them.

AlexisQapa commented 5 years ago

Thanks, I should have looked harder.