forked from onevcat/Kingfisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
409 lines (383 loc) · 23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<!DOCTYPE html>
<html lang="en">
<head>
<title>Kingfisher Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="Kingfisher Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">Kingfisher Docs</a> (80% documented)</p>
<p class="header-right"><a href="https://github.com/onevcat/Kingfisher"><img src="img/gh.png"/>View on GitHub</a></p>
<p class="header-right"><a href="dash-feed://http%3A%2F%2Fonevcat%2Egithub%2Eio%2FKingfisher%2Fdocsets%2FKingfisher%2Exml"><img src="img/dash.png"/>Install in Dash</a></p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">Kingfisher Reference</a>
<img id="carat" src="img/carat.png" />
Kingfisher Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/AnimatedImageView.html">AnimatedImageView</a>
</li>
<li class="nav-group-task">
<a href="Classes/AnimatedImageView/RepeatCount.html">– RepeatCount</a>
</li>
<li class="nav-group-task">
<a href="Classes/ImageCache.html">ImageCache</a>
</li>
<li class="nav-group-task">
<a href="Classes/ImageCache/CacheCheckResult.html">– CacheCheckResult</a>
</li>
<li class="nav-group-task">
<a href="Classes/ImageDownloader.html">ImageDownloader</a>
</li>
<li class="nav-group-task">
<a href="Classes/ImagePrefetcher.html">ImagePrefetcher</a>
</li>
<li class="nav-group-task">
<a href="Classes/Kingfisher.html">Kingfisher</a>
</li>
<li class="nav-group-task">
<a href="Classes/KingfisherManager.html">KingfisherManager</a>
</li>
<li class="nav-group-task">
<a href="Classes/RetrieveImageTask.html">RetrieveImageTask</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Global Variables.html#/s:10Kingfisher0A23DiskCacheCleanedHashKeySSv">KingfisherDiskCacheCleanedHashKey</a>
</li>
<li class="nav-group-task">
<a href="Global Variables.html#/s:10Kingfisher0A11ErrorDomainSSv">KingfisherErrorDomain</a>
</li>
<li class="nav-group-task">
<a href="Global Variables.html#/s:10Kingfisher0A18ErrorStatusCodeKeySSv">KingfisherErrorStatusCodeKey</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/CacheType.html">CacheType</a>
</li>
<li class="nav-group-task">
<a href="Enums/ContentMode.html">ContentMode</a>
</li>
<li class="nav-group-task">
<a href="Enums/ImageProcessItem.html">ImageProcessItem</a>
</li>
<li class="nav-group-task">
<a href="Enums/ImageTransition.html">ImageTransition</a>
</li>
<li class="nav-group-task">
<a href="Enums/ImageTransition.html">ImageTransition</a>
</li>
<li class="nav-group-task">
<a href="Enums/IndicatorType.html">IndicatorType</a>
</li>
<li class="nav-group-task">
<a href="Enums/KingfisherError.html">KingfisherError</a>
</li>
<li class="nav-group-task">
<a href="Enums/KingfisherOptionsInfoItem.html">KingfisherOptionsInfoItem</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Extensions/CGSize.html">CGSize</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Collection.html">Collection</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Data.html">Data</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Notification.html">Notification</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Notification/Name.html">– Name</a>
</li>
<li class="nav-group-task">
<a href="Extensions/String.html">String</a>
</li>
<li class="nav-group-task">
<a href="Extensions/URL.html">URL</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Functions.html#/s:10Kingfisher2ggoiAA14ImageProcessor_pAaC_p_AaC_ptF">>>(_:_:)</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/AnimatedImageViewDelegate.html">AnimatedImageViewDelegate</a>
</li>
<li class="nav-group-task">
<a href="Protocols/AuthenticationChallengeResponsable.html">AuthenticationChallengeResponsable</a>
</li>
<li class="nav-group-task">
<a href="Protocols/CIImageProcessor.html">CIImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Protocols/CacheSerializer.html">CacheSerializer</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ImageDownloadRequestModifier.html">ImageDownloadRequestModifier</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ImageDownloaderDelegate.html">ImageDownloaderDelegate</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ImageModifier.html">ImageModifier</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ImageProcessor.html">ImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Protocols/Indicator.html">Indicator</a>
</li>
<li class="nav-group-task">
<a href="Protocols/KingfisherCompatible.html">KingfisherCompatible</a>
</li>
<li class="nav-group-task">
<a href="Protocols/Placeholder.html">Placeholder</a>
</li>
<li class="nav-group-task">
<a href="Protocols/Resource.html">Resource</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Structs/AlignmentRectInsetsImageModifier.html">AlignmentRectInsetsImageModifier</a>
</li>
<li class="nav-group-task">
<a href="Structs/AnyImageModifier.html">AnyImageModifier</a>
</li>
<li class="nav-group-task">
<a href="Structs/AnyModifier.html">AnyModifier</a>
</li>
<li class="nav-group-task">
<a href="Structs/BlackWhiteProcessor.html">BlackWhiteProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/BlendImageProcessor.html">BlendImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/BlurImageProcessor.html">BlurImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs.html#/s:10Kingfisher11CGSizeProxyV">CGSizeProxy</a>
</li>
<li class="nav-group-task">
<a href="Structs/ColorControlsProcessor.html">ColorControlsProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/CompositingImageProcessor.html">CompositingImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/CroppingImageProcessor.html">CroppingImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs.html#/s:10Kingfisher9DataProxyV">DataProxy</a>
</li>
<li class="nav-group-task">
<a href="Structs/DefaultCacheSerializer.html">DefaultCacheSerializer</a>
</li>
<li class="nav-group-task">
<a href="Structs/DefaultImageModifier.html">DefaultImageModifier</a>
</li>
<li class="nav-group-task">
<a href="Structs/DefaultImageProcessor.html">DefaultImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/Filter.html">Filter</a>
</li>
<li class="nav-group-task">
<a href="Structs/FlipsForRightToLeftLayoutDirectionImageModifier.html">FlipsForRightToLeftLayoutDirectionImageModifier</a>
</li>
<li class="nav-group-task">
<a href="Structs/FormatIndicatedCacheSerializer.html">FormatIndicatedCacheSerializer</a>
</li>
<li class="nav-group-task">
<a href="Structs/ImageResource.html">ImageResource</a>
</li>
<li class="nav-group-task">
<a href="Structs/OverlayImageProcessor.html">OverlayImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/RectCorner.html">RectCorner</a>
</li>
<li class="nav-group-task">
<a href="Structs/RenderingModeImageModifier.html">RenderingModeImageModifier</a>
</li>
<li class="nav-group-task">
<a href="Structs/ResizingImageProcessor.html">ResizingImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs/RetrieveImageDownloadTask.html">RetrieveImageDownloadTask</a>
</li>
<li class="nav-group-task">
<a href="Structs/RoundCornerImageProcessor.html">RoundCornerImageProcessor</a>
</li>
<li class="nav-group-task">
<a href="Structs.html#/s:10Kingfisher11StringProxyV">StringProxy</a>
</li>
<li class="nav-group-task">
<a href="Structs/TintImageProcessor.html">TintImageProcessor</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher32ImageDownloaderCompletionHandlera">ImageDownloaderCompletionHandler</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher28ImageDownloaderProgressBlocka">ImageDownloaderProgressBlock</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher0A11OptionsInfoa">KingfisherOptionsInfo</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher27PrefetcherCompletionHandlera">PrefetcherCompletionHandler</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher23PrefetcherProgressBlocka">PrefetcherProgressBlock</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher21RetrieveImageDiskTaska">RetrieveImageDiskTask</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:10Kingfisher11Transformera">Transformer</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<p align="center">
<img src="https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/logo.png" alt="Kingfisher" title="Kingfisher" width="557"/>
</p>
<p align="center">
<a href="https://travis-ci.org/onevcat/Kingfisher"><img src="https://img.shields.io/travis/onevcat/Kingfisher/master.svg"></a>
<a href="https://github.com/Carthage/Carthage/"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat"></a>
<a href="http://onevcat.github.io/Kingfisher/"><img src="https://img.shields.io/cocoapods/v/Kingfisher.svg?style=flat"></a>
<a href="https://raw.githubusercontent.com/onevcat/Kingfisher/master/LICENSE"><img src="https://img.shields.io/cocoapods/l/Kingfisher.svg?style=flat"></a>
<a href="http://onevcat.github.io/Kingfisher/"><img src="https://img.shields.io/cocoapods/p/Kingfisher.svg?style=flat"></a>
<a href="https://codebeat.co/projects/github-com-onevcat-kingfisher"><img alt="codebeat badge" src="https://codebeat.co/assets/svg/badges/A-398b39-669406e9e1b136187b91af587d4092b0160370f271f66a651f444b990c2730e9.svg" /></a>
<a href="#backers" alt="sponsors on Open Collective"><img src="https://opencollective.com/Kingfisher/backers/badge.svg" /></a>
<a href="#sponsors" alt="Sponsors on Open Collective"><img src="https://opencollective.com/Kingfisher/sponsors/badge.svg" /></a>
</p>
<p>Kingfisher is a lightweight, pure-Swift library for downloading and caching images from the web. This project is heavily inspired by the popular <a href="https://github.com/rs/SDWebImage">SDWebImage</a>. It provides you a chance to use a pure-Swift alternative in your next app.</p>
<h2 id='features' class='heading'>Features</h2>
<ul>
<li>[x] Asynchronous image downloading and caching.</li>
<li>[x] <code>URLSession</code>-based networking. Basic image processors and filters supplied.</li>
<li>[x] Multiple-layer cache for both memory and disk.</li>
<li>[x] Cancelable downloading and processing tasks to improve performance.</li>
<li>[x] Independent components. Use the downloader or caching system separately as you need.</li>
<li>[x] Prefetching images and showing them from cache later when necessary.</li>
<li>[x] Extensions for <code>UIImageView</code>, <code>NSImage</code> and <code>UIButton</code> to directly set an image from a URL.</li>
<li>[x] Built-in transition animation when setting images.</li>
<li>[x] Customizable placeholder while loading images.</li>
<li>[x] Extensible image processing and image format support.</li>
</ul>
<p>The simplest use-case is setting an image to an image view with the <code>UIImageView</code> extension:</p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">url</span> <span class="o">=</span> <span class="kt">URL</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="s">"url_of_your_image"</span><span class="p">)</span>
<span class="n">imageView</span><span class="o">.</span><span class="n">kf</span><span class="o">.</span><span class="nf">setImage</span><span class="p">(</span><span class="nv">with</span><span class="p">:</span> <span class="n">url</span><span class="p">)</span>
</code></pre>
<p>Kingfisher will download the image from <code>url</code>, send it to both the memory cache and the disk cache, and display it in <code>imageView</code>. When you use the same code later, the image will be retrieved from cache and shown immediately.</p>
<h2 id='requirements' class='heading'>Requirements</h2>
<ul>
<li>iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+</li>
<li>Swift 4 (Kingfisher 4.x), Swift 3 (Kingfisher 3.x)</li>
</ul>
<p>Main development of Kingfisher is based on Swift 4. Only critical bug fixes will be applied to Kingfisher 3.x.</p>
<ul>
<li>Kingfisher 4.0 Migration - Kingfisher 3.x should be source compatible to Kingfisher 4. The reason for a major update is that we need to specify the Swift version explicitly for Xcode. All deprecated methods in Kingfisher 3 has been removed, so please ensure you have no warning left before you migrate from Kingfisher 3 to Kingfisher 4. If you have any trouble in migrating, please open an issue to discuss.</li>
<li><a href="https://github.com/onevcat/Kingfisher/wiki/Kingfisher-3.0-Migration-Guide">Kingfisher 3.0 Migration Guide</a> - If you are upgrading to Kingfisher 3.x from an earlier version, please read this for more information.</li>
</ul>
<h2 id='next-steps' class='heading'>Next Steps</h2>
<p>We prepared a <a href="https://github.com/onevcat/Kingfisher/wiki">wiki page</a>. You can find tons of useful things there.</p>
<ul>
<li><a href="https://github.com/onevcat/Kingfisher/wiki/Installation-Guide">Installation Guide</a> - Follow it to integrate Kingfisher into your project.</li>
<li><a href="https://github.com/onevcat/Kingfisher/wiki/Cheat-Sheet">Cheat Sheet</a>- Curious about what Kingfisher could do and how would it look like when used in your project? See this page for useful code snippets. If you are already familiar with Kingfisher, you could also learn new tricks to improve the way you use Kingfisher!</li>
<li><a href="http://onevcat.github.io/Kingfisher/">API Reference</a> - Lastly, please remember to read the full whenever you may need a more detailed reference.</li>
</ul>
<h2 id='other' class='heading'>Other</h2>
<h3 id='future-of-kingfisher' class='heading'>Future of Kingfisher</h3>
<p>I want to keep Kingfisher lightweight. This framework will focus on providing a simple solution for downloading and caching images. This doesn’t mean the framework can’t be improved. Kingfisher is far from perfect, so necessary and useful updates will be made to make it better.</p>
<h3 id='developments-and-tests' class='heading'>Developments and Tests</h3>
<p>Any contributing and pull requests are warmly welcome. However, before you plan to implement some features or try to fix an uncertain issue, it is recommended to open a discussion first. </p>
<p>The test images are contained in another project to keep this project repo fast and slim. You could run <code>./setup.sh</code> in the root folder of Kingfisher to clone the test images when you need to run the tests target. It would be appreciated if your pull requests could build and with all tests green. :)</p>
<h3 id='about-the-logo' class='heading'>About the logo</h3>
<p>The logo of Kingfisher is inspired by <a href="http://en.wikipedia.org/wiki/Tangram">Tangram (七巧板)</a>, a dissection puzzle consisting of seven flat shapes from China. I believe she’s a kingfisher bird instead of a swift, but someone insists that she is a pigeon. I guess I should give her a name. Hi, guys, do you have any suggestions?</p>
<h3 id='contact' class='heading'>Contact</h3>
<p>Follow and contact me on <a href="http://twitter.com/onevcat">Twitter</a> or <a href="http://weibo.com/onevcat">Sina Weibo</a>. If you find an issue, just <a href="https://github.com/onevcat/Kingfisher/issues/new">open a ticket</a>. Pull requests are warmly welcome as well.</p>
<h2 id='contributors' class='heading'>Contributors</h2>
<p>This project exists thanks to all the people who contribute. <a href="https://github.com/onevcat/Kingfisher/blob/master/CONTRIBUTING.md">[Contribute]</a>.
<a href="https://github.com/onevcat/Kingfisher/graphs/contributors"><img src="https://opencollective.com/kingfisher/contributors.svg?width=890" /></a></p>
<h2 id='backers' class='heading'>Backers</h2>
<p>Thank you to all our backers! 🙏 [<a href="https://opencollective.com/kingfisher#backer">Become a backer</a>]</p>
<p><a href="https://opencollective.com/kingfisher#backers" target="_blank"><img src="https://opencollective.com/kingfisher/backers.svg?width=890"></a></p>
<h2 id='sponsors' class='heading'>Sponsors</h2>
<p>Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [<a href="https://opencollective.com/kingfisher#sponsor">Become a sponsor</a>]</p>
<p><a href="https://opencollective.com/kingfisher/sponsor/0/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/1/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/2/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/3/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/4/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/5/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/6/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/7/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/8/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/kingfisher/sponsor/9/website" target="_blank"><img src="https://opencollective.com/kingfisher/sponsor/9/avatar.svg"></a></p>
<h3 id='license' class='heading'>License</h3>
<p>Kingfisher is released under the MIT license. See LICENSE for details.</p>
</section>
</section>
<section id="footer">
<p>© 2017 <a class="link" href="https://onevcat.com" target="_blank" rel="external">Wei Wang</a>. All rights reserved. (Last updated: 2017-12-28)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>