Swizzling does not change the name of the method. If that were the case, it would be impossible to call the method, since the runtime finds an implementation using the name. All he does is change the address of the code that runs when a particular method is called.
My guess about why the deleteBackward
method deleteBackward
not called is that the input system uses the method from the more complex UITextInput , most likely replaceRange:withText:
Try this and make your call if the text
argument is an empty string. Also make sure your swizzling function does not return an error.
source share