title: How to set only two image for single row in collection view
body: <p>I have tried with story board to create a collection view with image. Totally i have 6 images. So per row i need to show 2 images. And no gap should be in between two images in one row. when i open in all screen, it should be two image for single row. how to add this in my code:</p>
  
  <p><strong>ViewController.m :</strong></p>
  
  <pre><code>#import "ViewController.h"
  #import "CustomCell.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController {
  
      NSArray *arrayImages;
      NSArray *arrayLabel;
  
  }
  @synthesize MycollectionView;
  
  
  - (void)viewDidLoad {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
      [[self MycollectionView]setDataSource:self];
      [[self MycollectionView]setDelegate:self];
  
      arrayImages =[[NSArray alloc] initWithObjects:@"image1.png",@"image2.png",@"image3.png",@"image4.png",@"image5.png",@"image6.png", nil];
      arrayLabel = [[NSArray alloc] initWithObjects:@"image1",@"image2",@"image3",@"image4",@"image5",@"image6", nil];
  }
  // datasource and delegate method
  -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
      return 1;
  
  }
  -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
      return [arrayImages count];
  }
  -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *cellIdentifier = @"Cell";
      CustomCell *Cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
      [[Cell myimage] setImage:[UIImage imageNamed:[arrayImages objectAtIndex:indexPath.item]]];
      [[Cell myLabel]setText:[arrayLabel objectAtIndex:indexPath.item]];
  
  
      return Cell;
  
  }
  </code></pre>
  
  <p><strong>CustomCell.h</strong></p>
  
  <pre><code>@interface CustomCell : UICollectionViewCell
  
  
  @property (weak, nonatomic) IBOutlet UIImageView *myimage;
  
  
  @property (weak, nonatomic) IBOutlet UILabel *myLabel;
  
  @end
  </code></pre>