title: uicollectionview cell frame in portrait and landscape
body: <p>I am stuck in frame of uicollectionview cell frame
  what I want to do is,</p>
  
  <p>in landscape mode of iPad I want to show 3 cells,
  and in portrait 2 cells.</p>
  
  <p>when I write the code of frame in method <code>- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath</code>
  its not affecting the size of frame.</p>
  
  <p>I checked by applying debugger whether its coming in this method or not.
  but its coming and returning the size.</p>
  
  <p>by default I have to launch my application in landscape and then if required in portrait.</p>
  
  <p>Here is how its showing in landscape</p>
  
  <p><img src="https://i.stack.imgur.com/uZ8JL.png" alt="enter image description here"></p>
  
  <p>Here how this cells looking in portrait</p>
  
  <p><img src="https://i.stack.imgur.com/CBSu7.png" alt="enter image description here"></p>
  
  <p>Here is my code for frame</p>
  
  <pre><code>- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
  {
    //return [self.cellSizes[indexPath.item] CGSizeValue];
      if (UIDeviceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]))
      {
          return CGSizeMake(100, 100);
      }
      return CGSizeMake(200, 200);
  }
  </code></pre>
  
  <p>What ever value I pass, frame is not at all changing.
  I didn't passed any other frame value any where.</p>
  
  <p>I want to give hardcoded value to cell frame first then will go for dynamic.
  but I'm stuck at the first place only.
  Can any one please help me.</p>
  
  <p>Thanks in advance.</p>