3 ms·
Here's hoping they have a piece on Swizzling!
by Apocryphon 14y ago
Here's hoping they have a piece on Swizzling!
- matttthompson 14y agoDuly noted. Post on Swizzling and the new Objective-C literals are forthcoming :)
- ryanpetrich 14y agoWhen you do, please recommend one of the techniques/libraries that properly generate super calls.
- cluda01 14y agoThis sounds like a maintenance programmers worst nightmare. Although I'm coming from a Java background so naturally I have accrued an unhealthy amount of bias. Anybody from the more dynamic languages have any war stories about debugging/maintaining this sort of thing?
- mikeash 14y agoYou must use it really, really, really sparingly. There are cases where it's useful, but they're pretty rare. When you do it, you need to document the crap out of it. I've been lucky never to hit any code where someone did this kind of thing without taking that into consideration, so I can't say how bad it gets when it's screwed up. Used sparingly it can be pretty nice, but you have to be really sure you're not just overcomplicating things for no good reason.
- cpr 14y agoDoes swizzling really have a place in well-designed software today? (edit: changed everything. ;-)
- tumultco 14y agoI only use it in cases where an underlying framework does not expose or provide the functionality I need (and subclassing is not an option). I wouldn't necessarily say it means these frameworks are not well-designed though.
- bronxbomber92 14y agoIt's also useful for developing developer tools (for the same effect as interposing).
- pjmlp 14y agoYes, at least in unit tests. Sometimes you need to call stuff which you cannot work around so it is required to patch calls.