ios - Should I save my images in Core Data or should I use SDWebImage -
i have been developing app cloud/server data source. naturally process 1 thing @ time. @ present, fill tables, query server returns array. array contains urls images , urls load images using sdwebimage.
now entering stage of development need implement core data data in tables (i.e. texts , images). far considering following approaches:
- i can load array server core data (imagine properties as: firstname, lastname, photourl, shortbio) , pass photo url core data sdwebimage display image in table cells. or
- i can load array , image core data (i.e. load array core data in background , each row, load image core data)
of course point here if use sdwebimage save image in own caching system, limited understanding may or may not entirely consistent in core data. on other hand don't understand core data enough know if handles saving images in terms of performance (i.e. knows it's image , therefore handle file linking).
so best way this? can sdwebimage work in harmony core data? or sdwebimage redundant since core data enough itself?
another thing note presently, data loads server , images come sdwebimage loads each uiimageview. may not problem core data since ideally image in local db. thoughts?
regardless of question semantics, think need more hard information inform decision.
it useful know storing large images (larger than, say, thumbnails) not recommended , lead performance issues. core data has option large data can check "store in external record file". alternatively, can administer own cache data (in way can flexibly update images via download on per-need basis on each device sharing same data). accepted best practice store image url in core data (typically relative application directory) , handle file storage / display separately.
i not know sdwebimage, might provide of functionality need in light of above.
i hope helps make decision data architecture.
Comments
Post a Comment