Summarize the previous project:
The thing is, I need to finish the news app show in the custom cell
While saying Sdwebimage provides a way to load images asynchronously onto Uiimageview
But there are times. Required images are not required to be covered with Uiimageview
So abandoned, and later think it is quite two force. I can do this with a layer of border uiimageview underneath.
So, pretending to be tall, I have to write on my own.
Later look at other people's methods, find some feeling, or write out, but still built in the network good situation
Solutions
Mainly to do a few things:
1. In addition to the UI section, all loading operations are done in the background. This can be achieved by dispatch or Performselectorinbackground or nsoperationqueue. See: Multithreaded Programming with GCD in iOS development using Nsoperationqueue for multi-threaded operations in IOS development
2. Avoid background loading after you have completed multiple resources, the processing time to occupy the UI thread is too long. This can be accomplished through nsoperationqueue, where the presentation of the resource to the UI is executed one at a queue, and a forced wait after each operation is completed, which can be resolved with usleep (int microseconds).
3. Reuse the cell. Creating a cell is generally slow, must be reused, and even for performance, you can create enough cells to reuse the queue at the beginning of view creation.