1

I am trying to write a framework that would print certain log statements including class name and method name while that method is called on an object of that class. I want to do this without the need to modify the actual method. For instance, say there is a method -(void)sendButtonClicked, when control reaches this method the framework intercept and print the class and method name on console.

This is something like Method Swizzling.

Any clue?

Abhinav
  • 37,684
  • 43
  • 191
  • 309
  • 1
    It sounds like a job for aspect-oriented programming. Maybe this will lead to clues: http://stackoverflow.com/questions/24136535/does-swift-support-aspect-oriented-programming – Phillip Mills Jul 14 '16 at 12:09
  • Yes you are right @PhillipMills. Initial read of the shared link suggest what I am looking for. Thank you for sharing this! – Abhinav Jul 14 '16 at 12:13

0 Answers0