.. image:: https://travis-ci.org/jplana/TMInstanceMethodSwizzler.png?branch=master :target: https://travis-ci.org/jplana/TMInstanceMethodSwizzler
TMInstanceMethodSwizzler
is a class which allows you to replace or modify an object's method implementation without affecting any other objects of the same class and without side effects either. It might be useful, for instance, to implement Aspect Oriented Programing and to create partial object mocks for testing. You can whatch this YouTube video to know about it in greater detail.
TMTimeoutManager
is an example of use of the previous, which allows you to observe an object's method to be called before a certain timeout and specifying different blocks of code to be invoked depending on whether the method is called or not.
Both are the result of a Hack me up, an internal contest where Tuenti engineers are given 24 hours to develop whatever they think that might be useful, funny or worth making.
- Include the following line in your
Podfile
:pod 'TMInstanceMethodSwizzler', :git => 'https://github.com/tuenti/TMInstanceMethodSwizzler'
- Run
pod install
- Clone, add as a submodule or download TMInstanceMethodSwizzler.
- Add all the files under
Classes
to your project. - Make sure your project is configured to use ARC.
TMInstanceMethodSwizzler
was created by iOS team at Tuenti Technologies S.L..
You can follow Tuenti engineering team on Twitter @tuentieng.
TMInstanceMethodSwizzler
is available under the Apache License, Version 2.0. See LICENSE file for more info.