Skip to content

suhitp/SwiftGradientButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftGradientButton

A fully customisable subclass of the UIButton which allows you to create beautiful gradient buttons.

Swift Version License Platform

SwiftGradientButton is a library for to create custom GradientButton for iOS. It can be used to easily apply custom gradients on UIButton with custom startColor, endColor, startPoint, endPoint properties. Use cornerRadius property to apply rounded corners to GradientButton.

Requirements

  • iOS 11 or any higher version.
  • Xcode 9 or any higher version.
  • Swift 5.0 or any higher version.

Installation

  • SwiftGradientButton is compatible with Swift 5 as of release 0.1.0.

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

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

source 'https://github.com/cocoapods/specs.git'
platform :ios, '11.0'
use_frameworks!

pod 'SwiftGradientButton'

Then, run the following command:

$ pod install

How to use

UIStoryboard / Xib

change UIButton class to GradientButton and customise below properties

Programatically

import SwiftGradientButton in your UIViewController or UIView subclass file and create custom GradientButton property like below and apply customisations

 let gradientButton = GradientButton()
 gradientButton.cornerRadius = 5
 gradientButton.startColor = UIColor.blue
 gradientButton.endColor = UIColor.green
 gradientButton.startPoint = CGPoint(x: 0.0, y: 0.5)
 gradientButton.endPoint = CGPoint(x: 1.0, y: 0.5)

Author

Suhit Patil, suhit.patil@gmail.com

License

SwiftGradientButton is available under the MIT license.

About

A fully customisable subclass of the UIButton which allows you to create beautiful gradient buttons.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy