ios - UIImageView+AFNetworking maxConcurrentOperationCount -


this awesome uiimageview extension has af_sharedimagerequestoperationqueue, max concurrent number set

_af_sharedimagerequestoperationqueue.maxconcurrentoperationcount = nsoperationqueuedefaultmaxconcurrentoperationcount;

how access private field , set custom value maxconcurrentoperationcount? (i don't want edit files under cocoapods directly)

upd: generatorofone, looks best solution me. however, decided use sdwebimage, because provides cache out of box , allows set maxconcurrentoperationcount in line of code.

this private method has static nsoperationqueue. either go , poke code directly not change existing code librarues. suggest create new uiimageview category, expose method , set maxconcurrentoperationcount on it.

like,

@interface uiimageview(myextension)   + (nsoperationqueue *)af_sharedimagerequestoperationqueue; @end  @implementation uiimageview(myextension)   + (void)load {      nsoperationqueue *queue = [self af_sharedimagerequestoperationqueue];     queue.maxconcurrentoperationcount = 5;   } @end 

then, include extension in class , set maxconcurrentoperationcount.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -