Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nixzhu/Navi
Focus on avatar caching.
https://github.com/nixzhu/Navi
Last synced: 6 days ago
JSON representation
Focus on avatar caching.
- Host: GitHub
- URL: https://github.com/nixzhu/Navi
- Owner: nixzhu
- License: mit
- Created: 2015-09-27T18:20:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T06:35:00.000Z (over 7 years ago)
- Last Synced: 2024-12-05T11:50:35.685Z (7 days ago)
- Language: Swift
- Homepage:
- Size: 270 KB
- Stars: 115
- Watchers: 5
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - Navi - Focus on avatar caching. (Media / Image)
- awesome-ios-star - Navi - Focus on avatar caching. (Media / Image)
README
# Navi
Navi is designed for avatar caching, with style.
The name of **Navi** from movie [Avatar](https://en.wikipedia.org/wiki/Avatar_(2009_film)).
## Requirements
Swift 3.1, iOS 8.0
- Swift 2.3, use version 0.5.0
- Swift 3.0, use version 1.1.0## Usage
1. Make your User conform Avatar protocol.
``` swift
protocol Avatar {var url: URL? { get }
var style: AvatarStyle { get }
var placeholderImage: UIImage? { get }
var localOriginalImage: UIImage? { get }
var localStyledImage: UIImage? { get }func save(originalImage: UIImage, styledImage: UIImage)
}
```2. And, set avatar for your avatarImageView
``` swift
avatarImageView.navi_setAvatar(userAvatar)
```Check the demo for more information.
另有[中文介绍](https://github.com/nixzhu/dev-blog/blob/master/2015-10-08-navi.md)。
## Installation
### Carthage
```ogdl
github "nixzhu/Navi"
```### CocoaPods
```ruby
pod 'Navi'
```## Contact
NIX [@nixzhu](https://twitter.com/nixzhu)
## License
Navi is available under the MIT license. See the LICENSE file for more info.