Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/makomori/Tamamushi
Gradient NavigationBar library written in Swift
https://github.com/makomori/Tamamushi
Last synced: 3 months ago
JSON representation
Gradient NavigationBar library written in Swift
- Host: GitHub
- URL: https://github.com/makomori/Tamamushi
- Owner: makomori
- License: mit
- Created: 2016-12-06T07:21:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-25T04:40:58.000Z (about 5 years ago)
- Last Synced: 2024-05-20T18:38:10.998Z (6 months ago)
- Language: Swift
- Homepage:
- Size: 2.91 MB
- Stars: 95
- Watchers: 5
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gradient - Tamamushi - Gradient NavigationBar library. (Swift)
README
![Header of Tamamushi](https://github.com/makomori/Tamamushi/blob/master/tamamushi_header_gray.png)
# Tamamushi
Tamamushi is an easy to use gradient UINavigationBar written in Swift 3. You can use already defined gradient color sets like Facebook Messenger, YouTube, SoundCloud or other cool gradient color sets.And "Tamamushi" is the Japanese name of the insect which has beautiful gradient color wings.
## Requirements
- Swift 3
- Xcode 8## Installation
### Cocoapods
```
pod 'Tamamushi'
```### Carthage
Will be available soon.## Usage
```import Tamamushi``` in the class you set gradient UINavigationBar
### In AppDelegate
``` Swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
TMGradientNavigationBar().setInitialBarGradientColor(direction: .vertical, typeName: "SoundCloud")
return true
}
```### In UIViewController(with NavigationBar)
``` Swift
override func viewDidLoad() {
super.viewDidLoad()
TMGradientNavigationBar().setGradientColorOnNavigationBar(bar: (self.navigationController?.navigationBar)!, direction: .vertical, typeName: "Facebook Messenger")
}
```## Customization
### Using defined colors
You can use gradient color
defined in [gradients.json](https://github.com/makomori/Tamamushi/blob/master/Tamamushi/gradients.json).``` Swift
TMGradientNavigationBar().setInitialBarGradientColor(direction: .vertical, typeName: "SoundCloud")
```
Please look at the ist of gradient colors available.### Using original colors
Of course you can use original gradient colors.``` Swift
TMGradientNavigationBar().setInitialBarGradientColor(direction: .horizontal, startColor: .red, endColor: .blue)
```### Direction
you can choose the direction of gradation. (Default is vertical)```.horizontal```, or ```.vertical```
## License
This library is released with MIT license. And as a source of colors, JSON file from uiGradients by ghosh is used.