3 ms·
I don't really want to defend method swizzling (it's grotesque from some entirely reasonable perspectives). However, it does work on external/3rd party code (e.
by PaulDavisThe1st 8mo ago
I don't really want to defend method swizzling (it's grotesque from some entirely reasonable perspectives). However, it does work on external/3rd party code (e.g. audio plugins) even when you don't have control over their source code. I'm not sure you can pull that off with "better" approaches ...
- alwaysbeconsing 8mo agoProblem come when a third-party code do that swizzling, looking at you every iOS analytics framework to this day.
- bunderbunder 8mo agoThat’s the main use case I can think of. It’s possible with other languages but may require more hacking. I like monkey patching for testing legacy code. I like it less as a thing in production code because it can become a security and reliability problem.