iOS SDWebImage implementation principle

1) When I need to get the picture of the network door when we first need is URl not URl nothing, after obtaining URL achieve our SDWebImage not go directly to request network, but there is no check image cache and URl related pictures, if there is a direct return to the image, if not then the next step.

2) When the image cache is no picture, SDWebImage still does not get directly from the network, but rather whether there is a picture to check the sandbox, if present, put the sandbox corresponding picture image stored into the cache, and then pressing the first step of judgment.

3) If there is no sandbox, is displayed in FIG placeholder, then download queue buffer is determined according to whether the image is being downloaded, the download waiting if avoid secondary download. If there is no download queue is created, after the download is complete download operation is removed from the queue, and the image stored in picture cache.

4) refresh UI (of course the actual operation situation) the image stored in the buffer sandbox.

 

 

Guess you like

Origin www.cnblogs.com/fengfeng159/p/11104528.html