Skip to content

Commit

Permalink
added the KVO wrapper to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
mattetti committed Jun 6, 2012
1 parent 288ed0a commit 07816bf
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Expand Up @@ -197,6 +197,33 @@ simple interface:
# ['TF1', 'France 2', 'France 3']
```

### Observers
**Since: > version 0.4**

You can observe for object's changes and trigger blocks:

``` ruby
class ExampleViewController < UIViewController
include BW::KVO

def viewDidLoad
@label = "Initial state"

observe(@label, "text") do |old_value, new_value|
puts "Hello from viewDidLoad!"
end
end

def viewDidAppear(animated)
observe(@label, "text") do |old_value, new_value|
puts "Hello from viewDidAppear!"
end
end

end
```


### String

The Ruby `String` class was extended to add `#camelize` and
Expand Down

0 comments on commit 07816bf

Please sign in to comment.