Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kofktu/gradientable
Gradiention Protocol in iOS
https://github.com/kofktu/gradientable
gradient swift
Last synced: 2 months ago
JSON representation
Gradiention Protocol in iOS
- Host: GitHub
- URL: https://github.com/kofktu/gradientable
- Owner: Kofktu
- License: mit
- Created: 2017-10-17T04:02:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-09T08:56:32.000Z (about 7 years ago)
- Last Synced: 2024-09-13T02:08:49.316Z (3 months ago)
- Topics: gradient, swift
- Language: Swift
- Homepage:
- Size: 1.43 MB
- Stars: 26
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gradientable
![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg)
[![CocoaPods](http://img.shields.io/cocoapods/v/Gradientable.svg?style=flat)](http://cocoapods.org/?q=name%3AGradientable%20author%3AKofktu)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)- Gradiention Protocol in iOS
![alt tag](Screenshot/Gradientable.gif)
## Requirements
- iOS 9.0+
- Swift 4.0## Installation
#### CocoaPods
Gradientable is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'Gradientable'
```#### Carthage
For iOS 8+ projects with [Carthage](https://github.com/Carthage/Carthage)```
github "Kofktu/Gradientable"
```## Usage
#### Gradientable
```swift
public protocol Gradientable {
public func set(options: GradientableOptions)
public func set(animation: GradientableAnimation)
}```
#### GradientableOptions
- Gradient color, location, direction
```swift
public struct GradientableOptions {
var colors: [UIColor]?
var locations: [NSNumber]?
var direction: GradientableOptionsDirection?
}
```#### GradientableAnimation
- Gradient color change animation
```swift
public struct GradientableAnimation {
var from: [UIColor]?
var to: [UIColor]
var duration: TimeInterval = 0.4
}
```## References
#### Please tell me or make pull request if you use this library in your application :)## Authors
Taeun Kim (kofktu),
## License
Gradientable is available under the ```MIT``` license. See the ```LICENSE``` file for more info.