diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5a1561d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +## v2.0.0 +- updated for iOS7 (overlay is a translucent blur like `UIAlertView`) +- transitioned to ARC +- did unholy amounts of refactoring +- changed superclass to `UIControl` so target/action pattern can be used +- removed `delegate` which is now redundant thanks to target/action +- removed custom property `isOn`, use standard `selected` property now + +## v1.0.0 \ No newline at end of file diff --git a/README.md b/README.md index 3b017bd..6343336 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,29 @@ button.toggleOffBlock = ^(NKToggleOverlayButton *button) { }; ``` +You can query the button's current state using + +``` objective-c +button.isSelected; +``` + +You can update the button's state (without displaying the overlay, or triggering `toggleOnBlock`, `toggleOffBlock` or any target/action pairs to be called) using +``` objective-c +button.selected = YES; +``` +This is useful for setting an initial state of the button. + +You can programmatically set the button's state and optionally trigger the animated overlay using +``` objective-c +[button setSelected:YES animated:YES]; +``` + +Finally, you can toggle the button's state (switch between on and off), and optionally display the animated overlay using +``` objective-c +[button toggleSelectedAnimated:YES]; +``` + + ## Contact Find me on Twitter [@neilkimmett](http://www.twitter.com/neilkimmett), or drop me an email at neil at kimmett.me