title: iOS: How can I change the orientation of a UICollectionViewCell?
body: <p>I have a <code>UICollectionViewController</code> that I load when a user turns their iPad so as to put it into landscape orientation. The problem I’m having is that my <code>UICollectionViewCell</code>s are still loading as if it were in portrait orientation. I set the <code>UICollectionViewController</code> to landscape inside Interface Builder, and I’m using a custom cell class that I’ve called <code>CollectionViewCell</code>. Each cell contains just an image and a label.</p>
  
  <p>Is there something that I should be doing either in Interface Builder or in my code? I tried using <code>CGAffineTransformationMakeRotation</code>, but that was no help. If anyone else has encountered this before, I would be extremely grateful! Thanks very much!</p>
  
  <p>Here’s a bit of the code for reference:</p>
  
  <pre><code>-(void)viewDidLoad
  {
   self.collectionView.dataSource = self;
      self.collectionView.delegate = self;
  }
  
  - (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section
  {
      return listArray.count;
  }
  
  - (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView
  {
      return 1;
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {      
      CollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"devices" forIndexPath:indexPath];
     cell.statusImage.image=[UIImage imageNamed:@"Default.png"];
      cell.name.text=@"HEY !!!!!";
      return cell;
  }
  
  
  - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
      return CGSizeMake(320, 420);
  }
  
  - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
  {
      return UIEdgeInsetsMake(50, 20, 50, 20);
  
  }
  </code></pre>