Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

async / await and UICollectionView background image loading

$
0
0

Hi everybody!

I'm trying to figure out how to take advantage of the async / await patterns to download asynchronously remote images into a UICollectionView.

I'm trying to put async code inside a UICollectionViewDataSource's descendant GetCell method, in order to have the cell's image set after "await"ing the async download procedure to complete.

It's not clear how to turn the GetCell method to an async one, as I cannot write "await xxxx" statements in a sync method such as GetCell.

I'm always stuck with this kind of trouble, and I eventually get back to good old thread queues....

Can anyone give me a clue or a lead on this?

Thanks, Alberto.


Viewing all articles
Browse latest Browse all 204402

Trending Articles