Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

suhitp/SwiftGradientButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Swift VersionLicensePlatform

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 release0.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 yourPodfile:

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

letgradientButton=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

[8]ページ先頭

©2009-2025 Movatter.jp