Reputation: 1526
I'm developing an iOS framework and need to write a swizzling method (for viewDidAppear method in UIViewController).
My swizzling method works perfectly in my application. But when I cut/paste my header+implementation files to my framework and launch the app, it doesn't work. I put an NSLog
inside the load
method but it doesn't print anything.
For swizzling, I followed this tutorial: http://spin.atomicobject.com/2014/12/30/method-swizzling-objective-c/ I added my "UIViewController+Logging.h" inside the public headers.
Any idea why it doesn't work?
Upvotes: 0
Views: 558
Reputation: 5563
Thats because your category is not loaded automatically when the app starts. See this question : Objective-C categories in static library
Upvotes: 1