yager99 / BButton

BButton is a subclass of UIButton that looks like the Twitter Bootstrap buttons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#BButton 3.0

BButton is a subclass of UIButton that looks like the Twitter Bootstrap buttons.

New! Use Bootstrap version 2 or version 3 style!

Forked from @mattlawer / BButton and refactored for more awesome.

Includes @leberwurstsaft / FontAwesome-for-iOS, fixed for iOS from the original FontAwesome.

BButton Screenshot 1      BButton Screenshot 2

Features

  • iOS 6.1+, ARC, Storyboards
  • Style like Bootstrap 2 or 3
  • Set corner radius via UIAppearance
  • Option to show button 'disabled' state
  • Many button type (color) options
  • FontAwesome included

Installation

From CocoaPods

This fork

pod 'BButton',  :git => 'git://github.com/jessesquires/BButton.git'

Original repo

pod `BButton`

From source

  • Drag the BButton/ folder to your project (make sure you copy all files/folders)
  • #import "BButton.h"
  • Add Fonts provided by application key to Info.plist and include FontAwesome.ttf

plist

How To Use

With Storyboards

Create a UIButton and change its class to BButton

Create programmatically

Initialize with any of the following methods:

- (id)initWithFrame:(CGRect)frame type:(BButtonType)type style:(BButtonStyle)aStyle
- (id)initWithFrame:(CGRect)frame
               type:(BButtonType)type
              style:(BButtonStyle)aStyle
               icon:(FAIcon)icon
           fontSize:(CGFloat)fontSize
- (id)initWithFrame:(CGRect)frame color:(UIColor *)aColor style:(BButtonStyle)aStyle
- (id)initWithFrame:(CGRect)frame
              color:(UIColor *)aColor
              style:(BButtonStyle)aStyle
               icon:(FAIcon)icon
           fontSize:(CGFloat)fontSize
+ (BButton *)awesomeButtonWithOnlyIcon:(FAIcon)icon
                                  type:(BButtonType)type
                                 style:(BButtonStyle)aStyle
+ (BButton *)awesomeButtonWithOnlyIcon:(FAIcon)icon
                                 color:(UIColor *)color
                                 style:(BButtonStyle)aStyle

UI Appearance

Set corner radius for all buttons via UIAppearance

[[BButton appearance] setButtonCornerRadius:[NSNumber numberWithFloat:0.0f]];

BButton Screenshot 3      BButton Screenshot 4

See the included demo project BButtonDemo.xcodeproj

See FontAwesomeIcons.html for list of icons

Apps Using This Control

Gitty for GitHub

Hemoglobe

iPaint uPaint

Audiotrip

iExplorer for DeviantART

Contact me to have your app listed here.

MIT License

Copyright © 2012, Mathieu Bolard. All rights reserved.

Refactored by Jesse Squires, April 2013.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

##FontAwesome License

About

BButton is a subclass of UIButton that looks like the Twitter Bootstrap buttons

License:Other