Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Regarding the images, frequently we download them individually, and merely update the UI as stuff is downloaded, rather than forcing the user to wait for everything to download. Or lazy downloads are nice (such as afforded by <code>UIImageView</code> category, like <a href="https://github.com/rs/SDWebImage" rel="nofollow">SDWebImage</a>'s <code>UIImageView+WebCache</code>), effectively downloading the images as they're needed, that way the user can use the app without needing to wait for everything to download. </p> <p>Regarding the text, unless they're huge, you can download them together. Rather than zipping a bunch of text files, though, I think post people would be inclined towards some JSON-formatted response that returns the text files in some nice, easy to consume format by your app. There's a point (say, the combined JSON is more than 100k), though, where combining the text files together hits a point of diminishing returns, in which case you might want to pursue individual downloads.</p> <p>We need more background on what the app does and the breakdown of data (how big are the individual text files, how many, etc.) before providing meaningful counsel. But unless there absolutely no way for the app to function at all until everything is downloaded, I'd be inclined towards separate downloads for images, and some nice JSON-format single feed for the text.</p> <p>Let's assume for a second that you have some text description of a series of products, an an image associated with each. Then you might have a JSON that looks like:</p> <pre><code>[ { "id": 1, "description": "This product is ...", "image_url": "http://www.yourserver.com/images/img001.png" }, { "id": 2, "description": "This different product is ...", "image_url": "http://www.yourserver.com/images/img002.png" }, { "id": 3, "description": "This third product is ...", "image_url": "http://www.yourserver.com/images/img003.png" }, { "id": 4, "description": "This last product is ...", "image_url": "http://www.yourserver.com/images/img004.png" } ] </code></pre> <p>Your app might download that JSON (in which case it would have all of the text strings and a bunch of image URLs), and then present that in the UI, and where it needs to display the image, use the <code>UIImageView</code> category of <code>SDWebImage</code> to update the <code>image</code> of the <code>UIImageView</code> like so:</p> <pre><code>[cell.imageView setImageWithURL:[NSURL URLWithString:imageUrlString] placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload