0

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?

Candost
  • 1,029
  • 1
  • 12
  • 28
tdebroc
  • 1,436
  • 13
  • 28

1 Answers1

1

Thats because your category is not loaded automatically when the app starts. See this question : Objective-C categories in static library

Community
  • 1
  • 1
deadbeef
  • 5,409
  • 2
  • 17
  • 47