Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jogendra/JSButton
A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.
https://github.com/jogendra/JSButton
apple attributes-inspector cocoapods identity-inspector ios ios-app ios-ui labels storyboard swift swift-3 swift-language swift4 xcode
Last synced: about 1 month ago
JSON representation
A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.
- Host: GitHub
- URL: https://github.com/jogendra/JSButton
- Owner: jogendra
- License: mit
- Created: 2017-07-31T18:33:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-06T21:27:47.000Z (almost 7 years ago)
- Last Synced: 2024-12-01T03:41:53.378Z (about 1 month ago)
- Topics: apple, attributes-inspector, cocoapods, identity-inspector, ios, ios-app, ios-ui, labels, storyboard, swift, swift-3, swift-language, swift4, xcode
- Language: Swift
- Homepage: https://jogendra.github.io/
- Size: 188 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - JSButton - A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code. (UI / Button)
- awesome-ios-star - JSButton - A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code. (UI / Button)
README
# JSButton
[![Version](https://img.shields.io/cocoapods/v/JSButton.svg?style=flat)](http://cocoapods.org/pods/JSButton)
[![License](https://img.shields.io/cocoapods/l/JSButton.svg?style=flat)](http://cocoapods.org/pods/JSButton)
[![Platform](https://img.shields.io/cocoapods/p/JSButton.svg?style=flat)](http://cocoapods.org/pods/JSButton)
![Language](https://img.shields.io/badge/language-Swift%203-orange.svg)
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](https://twitter.com/imjog24)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)## Demo
```bash
$ 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](http://cocoapods.org) installed, grab it with `[sudo] gem install cocoapods`.
```bash
$ cd Example
$ pod install
$ open JSButton.xcworkspace
```## Requirements
- iOS 8.3+
- Xcode 9.0
- Swift 4.0## Installation
JSButton is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "JSButton"
```
### Manual InstallationJust 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`.
- Customize the view properties in the 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.
```swift
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](https://github.com/imjog/JSButton/blob/master/LICENSE) file for more info.