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

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -