You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-33
Original file line number
Diff line number
Diff line change
@@ -12,19 +12,48 @@ SDWebImagePhotosPlugin is a plugin for [SDWebImage](https://github.com/rs/SDWebI
12
12
13
13
By using this plugin, it allows you to use your familiar View Category method from SDWebImage, to load Photos image with `PHAsset` or `localIdentifier`.
14
14
15
+
16
+
## Requirements
17
+
18
+
+ iOS 8+
19
+
+ macOS 10.13+
20
+
+ tvOS 10+
21
+
+ Xcode 9+
22
+
23
+
## Installation
24
+
25
+
#### CocoaPods
26
+
27
+
SDWebImagePhotosPlugin is available through [CocoaPods](https://cocoapods.org). To install
28
+
it, simply add the following line to your Podfile:
29
+
30
+
```ruby
31
+
pod 'SDWebImagePhotosPlugin'
32
+
```
33
+
34
+
#### Carthage
35
+
36
+
SDWebImagePhotosPlugin is available through [Carthage](https://github.com/Carthage/Carthage).
37
+
38
+
Note that because the dependency SDWebImage currently is in beta. You should use `Carthage v0.30.1` or above to support beta [sem-version](https://semver.org/).
39
+
40
+
```
41
+
github "SDWebImage/SDWebImagePhotosPlugin"
42
+
```
43
+
15
44
## Usage
16
45
**Important!** To use Photos Library plugin. Firstly you need to register the photos loader to image manager.
17
46
18
47
There are two ways to register the photos loader. One for temporarily usage (when providing URL is definitely Photos URL but not HTTP URL), and another for global support (don't need any check, support both HTTP URL as well as Photos URL).
19
48
20
49
#### Use custom manager (temporarily)
21
-
You can create custom manager for temporary usage. When you use custom manager, be sure to specify `SDWebImageCustomManager` context option with your custom manager for View Category methods.
50
+
You can create custom manager for temporary usage. When you use custom manager, be sure to specify `SDWebImageContextCustomManager` context option with your custom manager for View Category methods.
You can replace the default managerusing [loaders manager](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#loaders-manager) to support both HTTP && Photos URL globally. Put these code just at the application launch time before any SDWebImage loading was triggered.
67
+
You can replace the default manager's loader implementation using [loaders manager](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#loaders-manager) to support both HTTP && Photos URL globally. Put these code just at the application launch time (or time just before `SDWebImageManager.sharedManager` initialized).
1. Since Photos Library image is already stored on the device disk. And query speed is fast enough for small resolution image. You can use `SDWebImageContextStoreCacheType` with `SDImageCacheTypeNone` to disable cache storage. And use `SDWebImageFromLoaderOnly` to disable cache query.
130
159
2. If you use `PHImageRequestOptionsDeliveryModeOpportunistic` (by default) to load the image, PhotosKit will return a degraded thumb image firstly and again with the full pixel image. When the image is degraded, the loader completion block will set `finished = NO`. But this will not trigger the View Category completion block, only trigger a image refresh (like progressive loading behavior for network image using `SDWebImageProgressiveLoad`)
131
160
132
-
## Requirements
133
-
134
-
+ iOS 8+
135
-
+ macOS 10.13+
136
-
+ tvOS 10+
137
-
+ Xcode 9+
138
-
139
-
## Installation
140
-
141
-
#### CocoaPods
142
-
143
-
SDWebImagePhotosPlugin is available through [CocoaPods](https://cocoapods.org). To install
144
-
it, simply add the following line to your Podfile:
145
-
146
-
```ruby
147
-
pod 'SDWebImagePhotosPlugin'
148
-
```
149
-
150
-
#### Carthage
151
-
152
-
SDWebImagePhotosPlugin is available through [Carthage](https://github.com/Carthage/Carthage).
153
-
154
-
Note that because the dependency SDWebImage currently is in beta. You should use `Carthage v0.30.1` or above to support beta [sem-version](https://semver.org/).
155
-
156
-
```
157
-
github "SDWebImage/SDWebImagePhotosPlugin"
158
-
```
159
-
160
161
## Demo
161
162
162
163
If you have some issue about usage, SDWebImagePhotosPlugin provide a demo for iOS && macOS platform. To run the demo, clone the repo and run the following command.
0 commit comments