Skip to content

Commit 56798ce

Browse files
committed
Update the readme
1 parent ade098a commit 56798ce

File tree

3 files changed

+55
-5
lines changed

3 files changed

+55
-5
lines changed

Example/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CHECKOUT OPTIONS:
3131

3232
SPEC CHECKSUMS:
3333
SDWebImage: 55c787b164fabe07f2a4d5307f6e1be7960fb9be
34-
SDWebImageYYPlugin: 3941a3f01e054bf6c6c64b5e14fb3ec1822fa994
34+
SDWebImageYYPlugin: 4a756eec055647c989fe9d54f9535780bc0e0465
3535
YYCache: 8105b6638f5e849296c71f331ff83891a4942952
3636
YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
3737

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,53 @@
55
[![License](https://img.shields.io/cocoapods/l/SDWebImageYYPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageYYPlugin)
66
[![Platform](https://img.shields.io/cocoapods/p/SDWebImageYYPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageYYPlugin)
77

8-
## Example
98

10-
To run the example project, clone the repo, and run `pod install` from the Example directory first.
9+
## What's for
10+
SDWebImageYYPlugin is a plugin for [SDWebImage](https://github.com/rs/SDWebImage/) framework, which provide the image loading support for [YYImage](https://github.com/ibireme/YYImage) (including YYImage's decoding system and `YYAnimatedImageView`) and [YYCache](https://github.com/ibireme/YYCache) cache system.
11+
12+
By using SDWebImageYYPlugin, you can use all you familiar SDWebImage's loading method, on the `YYAnimatedImageView`.
13+
14+
And you can also use `YYCache` instead of `SDImageCache` for image cache system, which may better memory cache performance (By taking advanced of LRU algorithm), and disk cache performance (By taking advanced of sqlite blob storage)
15+
16+
## Usage
17+
To load a network image, simply call the View Category method like UIImageView.
18+
19+
+ Objective-C
20+
21+
```objectivec
22+
YYAnimatedImageView *imageView;
23+
[imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.gif"]];
24+
```
25+
26+
+ Swift
27+
28+
```swift
29+
let imageView: YYAnimatedImageView
30+
imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.gif"))
31+
```
32+
33+
To enable `YYCache` instead of `SDImageCache`, you can bind the cache for shared manager, or create a custom manager instead.
34+
35+
You can also use `YYMemoryCache` or `YYDiskcache` to customize memory cache / disk cache only. See [Custom Cache](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#custom-cache-50) wiki in SDWebImage.
36+
37+
+ Objective-C
38+
39+
```objectivec
40+
// Assign to shared manager
41+
SDWebImageManger.defaultCache = [YYCache sharedCache];
42+
```
43+
44+
+ Swift
45+
46+
```swift
47+
SDWebImageManger.defaultCache = YYCache.shared
48+
```
1149

1250
## Requirements
1351

52+
+ iOS 8+
53+
+ Xcode 9+
54+
1455
## Installation
1556

1657
SDWebImageYYPlugin is available through [CocoaPods](https://cocoapods.org). To install
@@ -20,10 +61,19 @@ it, simply add the following line to your Podfile:
2061
pod 'SDWebImageYYPlugin'
2162
```
2263

64+
SDWebImageYYPlugin contains two subspecs, `YYCache` and `YYImage`. You can choose to enable only some of them. By default will contains all subspecs.
65+
66+
```ruby
67+
pod 'SDWebImageYYPlugin/YYImage'
68+
pod 'SDWebImageYYPlugin/YYCache'
69+
```
70+
2371
## Author
2472

2573
DreamPiggy, [email protected]
2674

2775
## License
2876

2977
SDWebImageYYPlugin is available under the MIT license. See the LICENSE file for more info.
78+
79+

SDWebImageYYPlugin.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ TODO: Add long description of the pod here.
3737

3838
s.subspec 'YYCache' do |ss|
3939
ss.dependency 'YYCache'
40-
ss.source_files = 'SDWebImageYYPlugin/Classes/YYCache/**/*'
40+
ss.source_files = 'SDWebImageYYPlugin/Classes/YYCache/**/*', 'SDWebImageYYPlugin/Module/SDWebImageYYPlugin.h'
4141
end
4242

4343
s.subspec 'YYImage' do |ss|
4444
ss.dependency 'YYImage/Core'
45-
ss.source_files = 'SDWebImageYYPlugin/Classes/YYImage/**/*'
45+
ss.source_files = 'SDWebImageYYPlugin/Classes/YYImage/**/*', 'SDWebImageYYPlugin/Module/SDWebImageYYPlugin.h'
4646
end
4747
end

0 commit comments

Comments
 (0)