Show Menu

Do you have a job opening?

Submit your 30 day Job Listing for FREE

HTPressableButton is designed for iOS developers to be able to spend time developing ideas, not building basic buttons.

These stylish and flat-designed buttons can easily be modified and are perfect for almost any project. With no worry over color choice, HTPressableButton also includes beautiful color schemes that perfectly suit with your app. Inspired by FlatUI and Designmodo.

If you want to get this component then check out the github: Here

Installation

HTPressableButton can be installed via Cocoapods


pod 'HTPressableButton'

You may also quickly try the HTPressableButton example project with


pod try 'HTPressableButton'

However, if you are only interested to use the color scheme provided (shown below) then


pod 'HTPressableButton/HTColor'

Button Types

IMPORTANT: You must specify the frame first. Also, do not forget to choose the style of the button you wish to add to your app.


HTPressableButton *rectButton = [HTPressableButton buttonWithType:UIButtonTypeCustom];
rectButton.frame = CGRectMake(30, 150, 260, 50);
rectButton.buttonColor = [UIColor grapeFruitColor];
rectButton.shadowColor = [UIColor grapeFruitDarkColor];
rectButton.style = HTPressableButtonStyleRect;
[rectButton setTitle:@"Rect" forState:UIControlStateNormal];
[self.view addSubview:rectButton];
iOS Custom Buttons for Application

Rounded rectangular buttons


HTPressableButton *roundedRectButton = [HTPressableButton buttonWithType:UIButtonTypeCustom];
roundedRectButton.frame = CGRectMake(30, 230, 260, 50);
roundedRectButton.style = HTPressableButtonStyleRounded;
[roundedRectButton setTitle:@"Rounded" forState:UIControlStateNormal];
[self.view addSubview:roundedRectButton];
iOS Rounded rectangular button

Circle iOS Buttons


//Circular mint color button
HTPressableButton *circularButton = [HTPressableButton buttonWithType:UIButtonTypeCustom];
circularButton.frame = CGRectMake(110, 300, 100, 100);
circularButton.style = HTPressableButtonStyleCircular;
circularButton.buttonColor = [UIColor mintColor];
circularButton.shadowColor = [UIColor mintDarkColor];
[circularButton setTitle:@"Circular" forState:UIControlStateNormal];
[self.view addSubview:circularButton];
Circle buttons in iOS Applications

Disabled Buttons

If you wish to create a disabled button, add:


buttonNameHere.enabled = NO;

Example:


HTPressableButton *disabledRoundedRectButton = [HTPressableButton buttonWithType:UIButtonTypeCustom];
disabledRoundedRectButton.frame = CGRectMake(30, 420, 260, 50);
disabledRoundedRectButton.style = HTPressableButtonStyleRounded;
disabledRoundedRectButton.disabledButtonColor = [UIColor pinkRoseColor];
disabledRoundedRectButton.disabledShadowColor = [UIColor pinkRoseDarkColor];
disabledRoundedRectButton.alpha = 0.5;
disabledRoundedRectButton.enabled = NO;
[disabledRoundedRectButton setTitle:@"DisabledButton" forState:UIControlStateNormal];
[self.view addSubview:disabledRoundedRectButton];
Disable buttons in iOS Application

The default alpha value is 1.0 for all type of buttons. The value can be changed (like the above button) by:


buttonNameHere.alpha = 0.5;
Attribute Values
Font Avenir
Font Size 18
Shadow Height buttonSize * 0.17 //17% of the button height
Button Color jayColor
Button Shadow Color jayDarkColor
Disabled Button Color mediumColor
Disabled Button Shadow Color mediumDarkColor

Additional Colors

You can freely use the additional colors in the file UIColors+HTColor anywhere in your project by:


[UIColor colorNameHere]

[UIColor jayColor]
[UIColor pinkRoseDarkColor]
HTPressable iOS Button Color Scheme

If you want to get this component then check out the github: Here

having issues?

We have a Questions and Answer section where you can ask your iOS Development questions to thousands of iOS Developers.

Ask Question

FREE Download!

Get your FREE Swift 2 Cheat Sheet and quick reference guide PDF download when you sign up to SwiftMonthly


Sharing is caring

If you enjoyed this tutorial, please help us and others by sharing using one of the social media buttons below.


iOS-Blog Admin Team

Written by:

We're here to help.

Comments

comments