Does storing a UIImage come with the asynchronous

2019-06-14 15:33发布

I am wondering... Currently I store UIImages I fetch from firebase as UIImages (instead of references as URL). I am considering making changes to the way I handle them... Namely changing the way I store them: to URL.

I am considering this because of 2 things:

  • I know that it takes up less space and is more proccessing friendly

  • But I also wonder if by saving it as a UIImage I am not making continues calls to firebase... Thus there is no reason for me to use sdWebImage with them. //Although maybe using sdWebImage would make using the URLs faster?

Is the second bullet correct? Which should I choose?

Note that I would have to also change the way I store the media given that currently I just have a spot called URL where I save either image or vid URL so I would have to change that location based on the kind of data. Which is fine if I must.

1条回答
放我归山
2楼-- · 2019-06-14 16:04

I am answering this based on my experience.

I completed the transition and found that fetching of content is multiple times faster then what it was before. Thus if you have a similar decision to make I advise going with the first bullet. That is: to store references in the DM and use something like SDWebImage when adding the images to the image view. Also if you notice some duplication of cells: check how many times you call reloadData() on the data.

Based on my findings the answer to the question would be: no.

查看更多
登录 后发表回答