Reputation: 5524
If I would like to have lazy loading like google+ or facebook app (maybe even 9gag), should I go with UITableView
or UIScrollView
?
The goal is to load whole new set of cells or scrollview
pages (not just thumbnail like apple lazyloading
tableview
). If you have facebook app, try scrolling down fast and you will see what I mean.
Any example would be also helpful.
Thanks.
Upvotes: 1
Views: 3066
Reputation: 534
Using Grand Central Dispatch you can do this.
The following link might be useful.
Upvotes: 1
Reputation: 8256
You can try this: https://github.com/nicklockwood/AsyncImageView
. This is a best example for loading images asynchronously. The library can also be used to load and cache images independently of a UIImageView as it provides direct access to the underlying loading and caching classes.
Upvotes: 1
Reputation: 1740
I would use a uicollection view. Here is an example that uses uitableview, but you can take it and modify it a bit to work with a collection view.
http://developer.apple.com/library/ios/#samplecode/LazyTableImages/Introduction/Intro.html
If you would like to use a third party library, I would suggest looking at AFNetworking It's one of the most highly used and has a very easy to use function that extends UIImageView LINK
Also as an FYI, a scrollview is part of a tableview.
Upvotes: 0
Reputation: 7633
Take a look at SDWebImage, really easy to use, it support caching and asynchronous loading.
Upvotes: 0
Reputation: 55
You should prefer table view for this. with tableview , You can use reusable customcell. tableview can be useful for Auto layout in landscape mode and if app is universal the tableview is more useful.
Upvotes: 1