BrandonDanis / BetterButton

iOS UIButton framework that facilitates adding beautiful buttons to your projects! 🔴

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BetterButton

Swift

iOS UIButton framework that facilitates adding beautiful buttons to your projects! 🔴

In my other projects, I always found myself styling buttons in similar fashion. Therefore I decided to create the BetterButton, which inherits from UIButton but has all the styling already done. Which saves me time and looks very good with no extra code no boilerplate code required!

Goals

My goals with this are to:

  • Button can shake
  • Button can display a loading icon (button.displayLoadingIcon())
  • Button can display a loading bar in the background
  • Add this project to CocoaPods to allow others to use it as well

What it currently looks like

Alt Text Pulse Button

How to use

Use it exactly like a normal UIButton, except it has some additional functionality such as shacking and pre-defined color themes. (more to come!)

let mainButton : BetterButton = {
    let btnFrame = CGRect(x: 50.0, y: 50.0, width: 200.0, height: 40.0)
    let btn = BetterButton(frame: btnFrame, style: .Rounded, color: .Purple)
    btn.setTitle("Enter", for: .normal)
    btn.translatesAutoresizingMaskIntoConstraints = false
    return btn
}()

About

iOS UIButton framework that facilitates adding beautiful buttons to your projects! 🔴


Languages

Language:Swift 95.0%Language:Objective-C 5.0%