I am new to iOS programing.
I have a requirement where I have to do server calls many times giving large JSON and then parsing and showing in TableView
/Collection
/View
Controllers
.
And I have to download Images inside Collection Grid View
and UITableView
, thereby starting/cancelling downloading of images on user scrolling.
So
Q1) For image downloading in Table View/Grid View I am thinking to use Apple Table Lazy Loading Sample + replacing Icon Downloader with that of SDWebImage
as mentioned here in link several problem in that Apple sample and via SDWebImage
I can config cache
as per my requirement.
EDIT: Basically I would like to have a very transparent way to get images from a url, so first look for them in a NSCache, if not found look on disk (or Core Data)l if not found again download async and then again save in cache as well.I guess SDWebImage provides this but for AFNetworking i have to look inside code and modify it.
iOS lazy-loading of table images
Q2) For server calls and JSON
parsing, whether I should go for using dispatch_async
and then parse JSON
using NSJSONSerialization
or I should go for using AFNetworking
for this
Disadvantage of using AFNetworking
lib is that I need only server call and parsing no other functionality..and for this reason if I would be going for this lib this would increase app size by 1.4 MB as I am already adding SDWebImage
framework (>3 MB).
This is what I found after lot of googling. Please suggest if I am missing something...and any other approach I should follow.