GitXplorerGitXplorer
s

GradientView

public
628 stars
100 forks
8 issues

Commits

List of commits on branch master.
Unverified
2ba23c51b7a4d55ee732379eb0eb35987a773185

Version 2.3.4

ssoffes committed 5 years ago
Unverified
e329cea0fef755c5546b5dbc47af3d925bf4d444

Upgrade for Xcode 10 and Swift 4.2 (#41)

gguykogus committed 6 years ago
Unverified
6cecfdc4191c79d1fb34ec82c8cb0f44893043a6

Update code example in Readme with new Swift syntax (#37)

rrichardtop committed 7 years ago
Unverified
c3ee2baaee3e31a05e8976357b930de280913a72

Version 2.3.3

ssoffes committed 7 years ago
Unverified
7e04d2f16148e12ea4ef25a895b2ad62c7ca0675

Version 2.3.2

ssoffes committed 7 years ago
Verified
33222c04857fbe4558528fb21316ff844a107a8b

Fix tvOS in podspec

ssoffes committed 7 years ago

README

The README file for this repository.

Gradient View

Easily use gradients in UIKit. Gradient View is a simple UIView wrapper around CGGradient.

Version Carthage compatible CocoaPods compatible

Usage

// Initialize a gradient view
let gradientView = GradientView(frame: CGRect(x: 20, y: 20, width: 280, height: 280))

// Set the gradient colors
gradientView.colors = [.green, .yellow]

// Optionally set some locations
gradientView.locations = [0.8, 1.0]

// Optionally change the direction. The default is vertical.
gradientView.direction = .horizontal

// Add some borders too if you want
gradientView.topBorderColor = .red
gradientView.bottomBorderColor = .blue

// Add it as a subview in all of its awesome
view.addSubview(gradientView)

See the source for full documentation.

Example

Screenshot 1 Screenshot 2

Open up the included Xcode project for an example app.

Installation

Gradient View supports installation with Carthage or CocoaPods. You can also simply add GradientView.swift to your project if you’d prefer.