Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
##DemoButton
## DemoButton

An UIButton enhancement for:
- Programmatic generation of button images using Core Image filters
- Caching the generated images in a Nimbus in-memory cache
- Setting custom line spacing on button text using MTLabel

###Basic Usage
- Programmatic generation of button images using Core Image filters
- Caching the generated images in a Nimbus in-memory cache
- Setting custom line spacing on button text using MTLabel

1. For generating filtered images -
a) To use Nimbus memory caching (ref. https://github.com/jverkoey/nimbus), add NIMEMCACHE=1 to Preprocessor Macros, Project Build Settings
b) Generate the filtered image using the UIButton category function
`- (UIImage *)generateImageUsingNormalImage:(UIImage *)normalImage
cacheName:(NSString *)cacheName
filterType:(NSString *)kFilterType
filterAttributes:(NSDictionary *)attributes`

2. For adjusting line spacing of button text -
Use the button subclass DemoButton and set buttonLabel instead of titleLabel (ref. https://github.com/Tuszy/MTLabel)

<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot1.PNG"/>
<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot2.PNG"/>
<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot3.png"/>
<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot4.png"/>
### Basic Usage

1. For generating filtered images -
a) To use Nimbus memory caching (ref. https://github.com/jverkoey/nimbus), add NIMEMCACHE=1 to Preprocessor Macros, Project Build Settings
b) Generate the filtered image using the UIButton category function
`- (UIImage *)generateImageUsingNormalImage:(UIImage *)normalImage
cacheName:(NSString *)cacheName
filterType:(NSString *)kFilterType
filterAttributes:(NSDictionary *)attributes`

2. For adjusting line spacing of button text -
Use the button subclass DemoButton and set buttonLabel instead of titleLabel (ref. https://github.com/Tuszy/MTLabel)

<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot1.PNG"/>
<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot2.PNG"/>
<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot3.png"/>
<img src="https://github.com/Dillion/DemoButton/raw/master/screenshot4.png"/>