A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.

Overview

JSButton

Version License Platform Language Twitter PRs Welcome

Demo

$ pod try JSButton

...or clone this repo and build and run/test the JSButton project in Xcode to see JSButton in action. If you don't have CocoaPods installed, grab it with [sudo] gem install cocoapods.

$ cd Example
$ pod install
$ open JSButton.xcworkspace

Requirements

  • iOS 8.3+
  • Xcode 9.0
  • Swift 4.0

Installation

JSButton is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JSButton"

Manual Installation

Just drag the JSButton.swift files into your project.

IBDesignable

JSButton includes IBInspectable annotations to enable configuring the label inside Interface Builder. However, if you see these warnings when building...

IB Designables: Failed to update auto layout status: Failed to load designables from path (null)
IB Designables: Failed to render instance of JSButton: Failed to load designables from path (null)

...then you are likely using JSButton as a static library, which does not support IB annotations. Some workarounds include:

  • Install JSButton as a dynamic framework using CocoaPods with use_frameworks! in your Podfile, or with Carthage
  • Install JSButton by dragging its source files to your project

Usage

Creating a view from the storyboard

  • If you already have a Label where you want to use then set it's class to JSButton in identity inspector.

  • Or drag a Button from object library and then change it's class to JSButton in identity inspector.

  • Set the module property to JSButton.

Add JSButton to storyboard

  • Customize the view properties in the attributes inspector.

Attributes inspector Attributes inspector

Add action to button

To add action to your button just use .action you dont have to add Target and then handler function.

yourButton.action {
  print("Button Pressed!")
}

Author

 Jogendra Singh

What's next

  • Any suggestions?

Contribution

  • If you found a bug, open an issue
  • If you have a feature request, open an issue
  • If you want to contribute, submit a pull request
  • If you have any issue or want help, please drop me a mail on [email protected]

License

JSButton is available under the MIT license. See the LICENSE file for more info.

You might also like...
A Custom UIButton with Centralised Styling and common styles available in Interface Builder
A Custom UIButton with Centralised Styling and common styles available in Interface Builder

DesignableButton DesignableButton is a UIButton subclass that uses a centralised and reusable styling. In InterfaceBuilder, drag and drop a Designable

Animated Social share buttons control for iOS written in Swift
Animated Social share buttons control for iOS written in Swift

SwiftShareBubbles Animated Social share buttons control for iOS written in Swift. This library is inspired AAShareBubbles. I tried AAShareBubbles with

Yet another animated flat buttons in Swift
Yet another animated flat buttons in Swift

DynamicButton is a powerful flat design button written in Swift to display hamburger button like with animated transitions between style updates. It a

 RadioGroup - The missing iOS radio buttons group.
RadioGroup - The missing iOS radio buttons group.

RadioGroup The missing iOS radio buttons group. Usage let radioGroup = RadioGroup(titles: ["First Option Title", "Another Option Title", "Last"]) radi

Added functionality that system buttons are not easy to implement
Added functionality that system buttons are not easy to implement

LLCustomButton Added functionality that system buttons are not easy to implement What are the functions ? Sets the position and spacing of text and im

Added functionality that system buttons are not easy to implement
Added functionality that system buttons are not easy to implement

LLCustomButton Added functionality that system buttons are not easy to implement What are the functions ? Sets the position and spacing of text and im

Inspired by Apple’s download progress buttons in the app store
Inspired by Apple’s download progress buttons in the app store

GBKUIButtonProgressView Inspired by Apple’s download progress buttons in the app store Created by @pklada and @miketsprague Checkout the blog post. In

LabelButtonKit is a mini library for labeled buttons (of SF Symbols), written entirely in SwiftUI
LabelButtonKit is a mini library for labeled buttons (of SF Symbols), written entirely in SwiftUI

A simple Button with an SFSymbol (icon) as a label, vertically. As well as a Dynamic Type variant using it horizontally. Using SwiftUI. A List View of buttons is also available here. Have fun! 🥳

TTopImageBottomLabelButton is a simple and flexible UI component fully written in Swift
TTopImageBottomLabelButton is a simple and flexible UI component fully written in Swift

TTopImageBottomLabelButton is a simple and flexible UI component fully written in Swift. TTopImageBottomLabelButton is developed to help programmers create a button with top image and bottom title quickly without having to write many lines of codes.

Owner
Jogendra
iOS / Backend Engineer | Aviation | Go | Swift | GSoC '18 | IIT BHU'20
Jogendra
An easy way to create beautiful social authentication buttons

EasySocialButton An easy way to create beautiful social authentication buttons Screenshots Installation Cocoa Pods pod 'EasySocialButton' Manual Drag

Antonio Zaitoun 162 Dec 11, 2022
A small and flexible (well documented) UIButton subclass with animated loading progress, and completion animation.

ButtonProgressBar-iOS Example For LIVE PREVIEW on Appetize in your browser itself, click here. To run the example project, clone the repo, and run pod

Pushkar Sharma 566 Dec 9, 2022
Lickable-Button We made the buttons on the screen look so good you'll want to lick them

Lickable-Button We made the buttons on the screen look so good you'll want to lick them. - Steve Jobs A little SwiftUI button project at WWDC 2021 Lic

Nate Thompson 14 Dec 29, 2021
An open-source library to use with SwiftUI, It allows you to create Floating menu action button.

Floating Menu Action Button Example Overview This is an open-source library to use with SwiftUI. It allows you to create Floating menu action button. Ins

ugo 3 Aug 19, 2022
Multiple state tap-to-toggle UIButton (like old camera flash button)

Multiple State Toggle UIButton A UIButton subclass that implements tap-to-toggle button text. (Like the camera flash and timer buttons) Usage Just cre

Yonat Sharon 83 Oct 11, 2022
🔥 PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎

PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! ?? An easy way to create custom and complex buttons with cust

Paolo Musolino 720 Nov 17, 2022
UIButton sublass for loading and transition animation.

TransitionButton Concept Source: Dribbble Preview Expand animation: Shake animation: Example To run the example project, clone the repo, then open the

null 1.4k Dec 25, 2022
UIButton-based view with fade in/out animation features

JTFadingInfoView Overview JTFadingInfoView is google's material design like notification view with smooth fade in/out animation features, based on UIB

Junichi Tsurukawa 129 Mar 19, 2022
Custom UIButton effect inspired by Google Material Design

ZFRippleButton iOS Custom UIButton effect inspired by Google Material Design written in Swift Usage Set the UIButton class in Nib to ZFRippleButton or

Amornchai Kanokpullwad 1.4k Dec 1, 2022
Full-featured IBDesignable UIButton class

SpicyButton Full-featured IBDesignable UIButton class Installation Add the following to your project's Podfile: pod 'SpicyButton' Usage You can easily

Luke Crum 2 Sep 6, 2022