4 ms·
That's what I mean by implemented better as something that is officially supported. In objective-c it's a hack, it can lead to hidden surprises since code usual
by mahyarm 12y ago
That's what I mean by implemented better as something that is officially supported. In objective-c it's a hack, it can lead to hidden surprises since code usually doesn't make it obvious that a specific method has been swizzled. And you have to deal with hidden expectations in code that you have no control over.
- emp 12y agoTrue, though then we are waiting and hoping for features. Another example of some runtime fun: my debug build swizzles interceptors for common UI lifecycle and action methods (viewDidLoad, didMoveToParentViewController:, sendAction:to:forEvent:, etc). When I am working on an app with many views, a simple glance at the console shows me what view controller displayed, what action a button fired and so on. Great for getting to relevant code quickly. I don't think I could hope for this as a standard feature of a language.