title: iOS Subclass UICollectionViewCell custom init method
body: <p>I'm implementing a custom UICollectionViewCell, and I want to know how to send model data to it so the data can be used to initialize the subviews of the cell.</p>
  
  <p>I register my MyCollectionViewCell by doing..</p>
  
  <pre><code>[self.collectionView registerClass:[MyCollectionViewCell class] forCellWithReuseIdentifier:@"MyCell"];
  </code></pre>
  
  <p>and in the following method, I do...</p>
  
  <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  
  MyCollectionViewCell* cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:@"MyCell" forIndexPath:indexPath];
  </code></pre>
  
  <p>The problem I'm facing is, when a cell isn't in the reuse queue, it initializes a new cell by calling the initWithFrame method (which the documentation confirms should happen). However, I have a custom init method in my MyCollectionViewCell class, which is... </p>
  
  <pre><code>-(id) initWithFrame:(CGRect)frame withData: (NSDictionary*) data;
  </code></pre>
  
  <p>I want my custom initialize method to be called instead. How would I do that? I'm not using any nibs and I'm doing everything programmatically. </p>
  
  <p>If there's no way, and I must use the initWithFrame method instead, how else can I pass model data to my MyCollectionViewCell so that I can initialize the subviews with that data?</p>
  
  <p>Thanks!</p>