tdebroc
tdebroc

Reputation: 1526

Swizzling Not Working in a framework

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

Answers (1)

deadbeef
deadbeef

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

Related Questions