title: How to find out the size of current iPhone screen to set the itemSize dynamically?
body: <p>I need to make the cell in the <code>collectionView</code> as wide as the screen allows.
  Apparently this should be reached by <code>itemSize</code> property.</p>
  
  <p>In my example I have set the width to 400, but how can I set to to the width of the user's screen?</p>
  
  <pre><code>- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
          UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
          layout.sectionInset = UIEdgeInsetsMake(10, 10, 9, 10);
          layout.itemSize = CGSizeMake(400, 150);
          self.collectionView = [[NewsSummaryCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
  }
  </code></pre>
  
  <p><a href="https://github.com/ashfurrow/AFTabledCollectionView/blob/master/AFTabledCollectionView/AFTableViewCell.m#L23" rel="nofollow noreferrer">Rest of the code</a></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Still not wide enough, the next cell on right hand side can still be seen.</p>
  
  <p><a href="https://i.stack.imgur.com/ACe4E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ACe4E.png" alt="enter image description here"></a></p>