All Projects → loregr → Lgbutton

loregr / Lgbutton

Licence: mit
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.

Programming Languages

swift
15916 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Lgbutton

Font Awesome Swift
Font Awesome swift library for iOS.
Stars: ✭ 743 (-66.47%)
Mutual labels:  xcode, font, font-icons
Pmsuperbutton
🔥 PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎
Stars: ✭ 653 (-70.53%)
Mutual labels:  interface-builder, button, uibutton
Swifticonfont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon)
Stars: ✭ 1,094 (-50.63%)
Mutual labels:  font, uibutton
Transitionbutton
UIButton sublass for loading and transition animation.
Stars: ✭ 1,124 (-49.28%)
Mutual labels:  button, uibutton
Spbutton
自定义按钮,图片可在上、左、下、右,可调整图文间距,新增属性支持storyBoard/xib,系统按钮的所有属性和方法依然生效
Stars: ✭ 91 (-95.89%)
Mutual labels:  button, uibutton
Ttsegmentedcontrol
An elegant, animated and customizable segmented control for iOS created by Tapptitude
Stars: ✭ 471 (-78.75%)
Mutual labels:  xcode, interface-builder
Hhcustomcorner
Awesome library to customize corners of UIView and UIButton. Now you can customize each corner differently
Stars: ✭ 36 (-98.38%)
Mutual labels:  button, uibutton
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-96.57%)
Mutual labels:  xcode, uibutton
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (-80.32%)
Mutual labels:  xcode, interface-builder
Emspinnerbutton
UIButton sublcass with loading animation
Stars: ✭ 117 (-94.72%)
Mutual labels:  button, uibutton
Everlayout
Reusable, downloadable, up-datable iOS layouts
Stars: ✭ 103 (-95.35%)
Mutual labels:  xcode, interface-builder
Font Awesome Scss
Font Awesome Scss Core (Unofficial)
Stars: ✭ 119 (-94.63%)
Mutual labels:  font, font-icons
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (-22.38%)
Mutual labels:  uibutton, uicontrol
Progressbutton
Custom ProgressButton
Stars: ✭ 52 (-97.65%)
Mutual labels:  button, uibutton
Hero
Elegant transition library for iOS & tvOS
Stars: ✭ 20,547 (+827.21%)
Mutual labels:  xcode, ios-lib
Linearicons
Linearicons is the highest quality set of line icons, matching with minimalist UI designs in iOS.
Stars: ✭ 64 (-97.11%)
Mutual labels:  font, font-icons
Xcode Monokai Revisited
Monokai Revisited Xcode Theme
Stars: ✭ 272 (-87.73%)
Mutual labels:  xcode, font
Squishbutton
A button that squishes when pressed. As seen in the Clips app.
Stars: ✭ 401 (-81.9%)
Mutual labels:  xcode, button
Swiftcocoadsl
An easy way to write iOS UI
Stars: ✭ 103 (-95.35%)
Mutual labels:  ios-lib, uibutton
Xib2storyboard
A tool to convert Xcode .xib to .storyboard files
Stars: ✭ 121 (-94.54%)
Mutual labels:  xcode, interface-builder

logo

build platform license Version

A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.

Preview

You'll be able to create buttons like these by using only the interface builder:

preview

Moreover you can use them for asynchronous operations.

async

Install

To integrate LGButton into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

pod 'LGButton'

Icons and images

You can add images/icons to your button, icons are taken from different ready to use font icons collections, images can be imported directly from your project assets folder.

You can customise icons/images on the left and/or on the right of the button title.

Icons

Icons are managed by SwiftIconFont integration, so you can easily add and customise button icons by choosing from the most popular font icons collections. In particular:

Collection Font name Cheat Sheet
Font Awesome fa List
Ion Icons io List
Octicons oc List
Open Iconic ic List
Material Icon ma List
Themify ti List
Map Icons mi List

The main properties that you need to set in order to use font icons are:

  • Icon Font Name: you can pick one value from the table above, different values will be ignored (please consider that not all the icons may be available since this library may not be updated right after a font library update).

  • Icon String: the icon name taken from the cheatsheet without the collection prefix.

So, if you want to use fa-align-left from Font Awesome, Icon Font Name will be fa and Icon String will be align-left.

Images

Set the Image source property in order to use an image from your assets folder.

Note: if Image source is set, every other property about the font icon on the same side will be ignored.

Usage

Drag and drop an UIView object into your view controller and set its class and module to LGButton.

class

Customise your button by setting the properties from the Interface Builder.

properties_1 properties_2

Supported Attributes

Attribute Description Default value
Bg Color Main background color clear
Show Touch Feedback Whether a touch feedback should be visible or not true
Gradient Start Color The first color of the gradient background nil
Gradient End Color The second color of the gradient background nil
Gradient End Color The second color of the gradient background nil
Gradient Horizontal Whether the gradient should be horizontal or not false
Gradient Rotation Set the gradient rotation angle (degrees from -360 to 360) 0
Corner Radius The corner radius 0.0
Fully Rounded Corners Apply a corner radius equals to height/2 false
Border Color The border color white
Border Width The border width 0.0
Title Color The title color white
Title String The title string EMPTY_STRING
Title Font Name The title font name nil
Title Font Size The title font size 14.0
Vertical orientation If true the left icon will be placed on the top and the right icon will be placed on the bottom false
Left Icon String The name of the left icon (taken from the cheat sheet) EMPTY_STRING
Left Icon Font Name The name of the left icon font name (taken from the table above) EMPTY_STRING
Left Icon Font Size The left icon font size 14.0
Left Icon Color The left icon color white
Left Image Src The name of the left source asset nil
Left Image Height The left image height 20.0
Left Image Width The left image width 20.0
Left Image Color The left image tint color nil
Right Icon String The name of the right icon (taken from the cheat sheet) EMPTY_STRING
Right Icon Font Name The name of the right icon font name (taken from the table above) EMPTY_STRING
Right Icon Font Size The right icon font size 14.0
Right Icon Color The right icon color white
Right Image Src The name of the right source asset nil
Right Image Height The right image height 20.0
Right Image Width The right image width 20.0
Right Image Color The right image tint color nil
Spacing Title Icon The spacing between the title and the image/icon 16.0
Spacing Top The internal top spacing 8.0
Spacing Bottom The internal bottom spacing 8.0
Spacing Leading The internal leading spacing 16.0
Spacing Trailing The internal trailing spacing 16.0
Shadow Offset The shadow offset (0,0)
Shadow Radius The shadow radius 0.0
Shadow Opacity The shadow opacity 1.0
Shadow Color The shadow color black
Loading spinner Color The loading spinner color white
Loading String The loading message text EMPTY_STRING
Loading Font Name The loading message font name EMPTY_STRING
Loading Font Size The loading message font size 14.0
Left Aligned true if the button items should be aligned to the left. It requires the button to have a fixed width false
Right Aligned true if the button items should be aligned to the right. It requires the button to have a fixed width false

You can download the demo project if you want to check more.

Issues

Feel free to submit issues and features requests.

Contributing

Contributions are more then welcome. Your contribution may include bug fixing or/and new features.

Please follow the "fork-and-pull" Git workflow (check here for more).

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that I can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Author

Lorenzo Greco

Credits

SwiftIconFont project is used in order to provide ready to use icons.

License

MIT License

Copyright (c) 2017 Lorenzo Greco

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].