Using Azure Marketplace’s Bing Image Search on iOS with UICollectionView in C#

The Windows Azure Marketplace now includes the Bing web service. Using the image search feature, combined with a UICollectionView, can be used to display images in a grid on iOS like this:

Consuming the Bing service with Xamarin on iOS can be accomplished just like anywhere else C# is available.  The UI here consists of a UICollectionView, using a UICollectionViewFlowLayout to achieve the grid display. Programming against a UICollectionView is very similar to using a UITableView, the big difference being that UICollectionView works with a layout class to achieve any layout you desire. iOS provides a very flexible UICollectionViewFlowLayout class that can be used  when a line-based layout is needed. Also, you can subclass UICollectionViewLayout directly as well to implement layouts that aren’t line-based.

You can get the code for this example here:

To run the exmaple, you need to sign up for an API key from the Windows Azure Marketplace.

For more information on using Collection Views, see this article in Xamarin’s Developer Center:

Voices That Matter: iOS Conference discount code

Update: 10 people registered with my speaker code, for which I received $500 that I am donating to the Jimmy Fund. Thanks to everyone who attended and to Pearson for hosting the conference.

I’m honored to be speaking at the Voices That Matter: iOS Developers Conference in Boston November 12-13. The conference organizers sent me a speaker’s priority code to pass along, which is good for $150 discount off the price of the core conference. The discount even applies in addition to the early bird pricing. My code is BSTSPK6. Also, I’ll receive $50 for every person that registers with my code, the proceeds of which I will be donating to the Jimmy Fund. I hope to see you at the conference in November.