Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Build a photo browser iphone app

A new UICollectionViewFlowLayout object named layout is initialized below. On the next line, modify it's size to 100x100.

The code:

  1. UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; 2.
  2. /* Write your code below this line */

2 Answers

Here's my "Best Answer":

layout.itemSize = CGSizeMake(100, 100);

So what is your problem? You want to set the itemSize for your layout to 100x100? Subclass UICollectionViewFlowLayout and set the itemSize parameter to those dimensions.

UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc]init];
flowLayout.itemSize = CGSizeMake(100, 100);