Apache License, 2.0 FREE

The Apache License, 2.0 is an
open-source license.
Read full license

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

(9 ratings)

iOS Button Image Generator

Programmatic button image generation (with caching) and button title customization for iOS applications.

Share and win up to $15k in prizes each month!Learn more

Share

Description

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
Back to top

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)

Back to top

Demo project as a preview tool

Use the demo project as a tool to preview filter effects
1. Replace button images with your own
2. Adjust button frame size
3. Scroll the filter panel to select a filter
4. Lock the filter scroll and adjust sliders to set filter settings
5. Tap on button to view the generated image, or set flash switch to on (alternates between generated and normal image)

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.
View all 6 reviews »

User Reviews