You should register each nib file you need with viewDidLoad, something like this (substituting the correct names for the nib file and identifier):
[self.collectionView registerNib:[UINib nibWithNibName:@"RDCell" bundle:nil] forCellWithReuseIdentifier:@"FirstType"];
Then, in itemForRowAtIndexPath, check the type and return the correct cell type:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { if (type = @"firstType") { FirstCell *cell = (FirstCell *) [collectionView dequeueReusableCellWithReuseIdentifier:@"FirstType" forIndexPath:indexPath]; return cell; }else{ SecondCell *cell = (SecondCell *) [collectionView dequeueReusableCellWithReuseIdentifier:@"SecondType" forIndexPath:indexPath]; cell.whatever ..... return cell; } }
source share