Authored by Olivier Poitrey

Remove outdated motivation section

Showing 1 changed file with 1 additions and 51 deletions
@@ -19,49 +19,6 @@ It provides: @@ -19,49 +19,6 @@ It provides:
19 NOTE: The version 3.0 of SDWebImage isn't fully backward compatible with 1.0 and requires iOS 5.0 19 NOTE: The version 3.0 of SDWebImage isn't fully backward compatible with 1.0 and requires iOS 5.0
20 minimum. If you need iOS < 5.0 support, please use the last 2.0 version. 20 minimum. If you need iOS < 5.0 support, please use the last 2.0 version.
21 21
22 -Motivation  
23 -----------  
24 -  
25 -As a dummy Objective-C developer working on my first iPhone application for my company  
26 -([Dailymotion][]), I've been very frustrated by the lack of support in the Cocoa Touch framework for  
27 -UITableView with remote images. After some Googling, I found lot of forums and blogs coming up with  
28 -their solution, most of the time based on asynchronous usage with NSURLConnection, but none provided  
29 -a simple library doing the work of async image grabbing + caching for you.  
30 -  
31 -Actually there is one in the famous [Three20][] framework by [Joe Hewitt][], but it's a massive  
32 -and undocumented piece of code. You can't import just the the libraries you want without taking the  
33 -whole framework (damn #import "TTGlobal.h"). Anyway, the [Three20][] implementation is based on  
34 -NSURLConnection, and I soon discovered this solution wasn't ideal. Keep reading to find out why.  
35 -  
36 -As a hurried beginner in iPhone development, I couldn't attempt to implement my own async image  
37 -grabber with caching support as my first steps in this new world. Thus, I asked for help from my good  
38 -friend Sebastien Flory ([Fraggle][]), who was working on his great iPhone game ([Urban Rivals][], a  
39 -future app-store hit) for almost a year. He spent quite an amount of time implementing the very  
40 -same solution for his needs, and was kind enough to give me his implementation for my own use. This  
41 -worked quite well and allowed me to concentrate on other parts of my application. But when I started  
42 -to compare my application with its direct competitor - the built-in Youtube application - I was very  
43 -unhappy with the loading speed of the images. After some network sniffing, I found that every HTTP  
44 -requests for my images was 10 times slower than Youtube's... On my own network, Youtube was 10  
45 -time faster than my own servers... WTF??  
46 -  
47 -In fact, my servers were fine but a lot of latency was added to the requests, certainly because my  
48 -application wasn't responsive enough to handle the requests at full speed. Right then, I  
49 -understood something important, asynchronous NSURLConnections are tied to the main runloop in the  
50 -NSEventTrackingRunLoopMode. As explained in the documentation, this runloop mode is affected by  
51 -UI events:  
52 -  
53 -> Cocoa uses this mode to restrict incoming events during mouse-dragging loops and other sorts of  
54 -> user interface tracking loops.  
55 -  
56 -A simple test to recognize an application using NSURLConnection in its default mode to load  
57 -remote images is to scroll the UITableView with your finger to disclose an unloaded image, and to  
58 -keep your finger pressed on the screen. If the image doesn't load until you release you finger,  
59 -you've got one (try with the Facebook app for instance). It took me quite some time to understand  
60 -the reason for this lagging issue. Actually I first used NSOperation to workaround this issue.  
61 -  
62 -This technique combined with an image cache instantly gave a lot of responsiveness to my app.  
63 -I thought this library could benefit other Cocoa Touch applications so I open-sourced it.  
64 -  
65 Who Use It 22 Who Use It
66 ---------- 23 ----------
67 24
@@ -274,11 +231,4 @@ community can help you solve it. @@ -274,11 +231,4 @@ community can help you solve it.
274 Future Enhancements 231 Future Enhancements
275 ------------------- 232 -------------------
276 233
277 -- LRU memory cache cleanup instead of reset on memory warning  
278 -  
279 -[Dailymotion]: http://www.dailymotion.com  
280 -[Fraggle]: http://fraggle.squarespace.com  
281 -[Urban Rivals]: http://fraggle.squarespace.com/blog/2009/9/15/almost-done-here-is-urban-rivals-iphone-trailer.html  
282 -[Three20]: http://groups.google.com/group/three20  
283 -[Joe Hewitt]: http://www.joehewitt.com  
284 -[tutorial]: http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4 234 +- LRU memory cache cleanup instead of reset on memory warning