Skip to content

Commit

Permalink
Updated readme for version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
belkevich committed Oct 9, 2013
1 parent a156e20 commit 7c4884a
Showing 1 changed file with 33 additions and 32 deletions.
65 changes: 33 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
OCFuntime
============

## About
#### About
[![Build Status](https://travis-ci.org/belkevich/ocfuntime.png?branch=develop)](https://travis-ci.org/belkevich/ocfuntime)

OCFuntime is a simple wrapper on [Objective-C runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html). So if you don't know the easiest way to shoot off your both legs then this solution for you! Time to have a fun!

---

## Installation
**Install via [cocoapods](http://cocoapods.org/)**
Include `ocfuntime` pod in you Podfile
#### Features
* Change instance method implementation
* Change class method implementation
* Return value of any type or don't return anything
* Revert to default method implementation

#### Installation
Include `ocfuntime` pod in Podfile

---

## Using
**Create funtime instance**
#### Using
```objective-c
OCFuntime *funtime = [[OCFuntime alloc] init];
```

**Change instance method implementation**
```objective-c
[funtime changeClass:[MyClass class] instanceMethod:@selector(instanceMethod) implementation:^
// Change instance method implementation
[funtime changeClass:[MyClass class] instanceMethod:@selector(someInstanceMethod)
implementation:^
{
NSLog(@"Changed FUN instance method!");
return 1;
}];
```
**Change class method implementation**
```objective-c
[funtime changeClass:[MyClass class] classMethod:@selector(classMethod) implementation:^
// Change class method implementation
[funtime changeClass:[MyClass class] classMethod:@selector(someClassMethod)
implementation:^
{
NSLog(@"Changed FUN class method!");
return [[NSObject alloc] init];
}];
```

**Revert method to default implementation**
```objective-c
[funtime revertClass:[MyClass class] method:@selector(method)];
```
**Revert all methods of class to default implementation**
```objective-c
//Revert method to default implementation
[funtime revertClass:[MyClass class] instanceMethod:@selector(someInstanceMethod)];
[funtime revertClass:[MyClass class] classMethod:@selector(somClassMethod)];
// Revert all methods of class to default implementation
[funtime revertClass:[MyClass class]];
```

**Revert all changed methods to default implementation**
```objective-c
// Revert all changed methods to default implementation
[funtime revertAll];
```
---
## Updates
#### Changes
[@okolodev](https://twitter.com/okolodev)
---
## Spec status
![Build status](https://api.travis-ci.org/belkevich/ocfuntime.png)
**Version 0.1.0**
* Added exception if changed method doesn't exist in the class
* Fixed reverting to default method implementation, not previous implementation
* Fixed changing class and instance method with the same name
* Fixed setting empty implementations
* Converted to ARC

0 comments on commit 7c4884a

Please sign in to comment.