title: Why is UICollectionViewCell's outlet nil in Interface Builder Xcode7.1 OS X Yosemite?
body: <p>I have created a custom UICollectionViewCell in Interface Builder, When I run the project, the UICollectionViewCell's subViews are nil, subviews doesn't show.</p>
  
  <p>I checked on the Internet, someBody say " **I am calling </p>
  
  <p><code>self.collectionView.registerClass(YNAskQuestionTextCollectionViewCell.self, forCellWithReuseIdentifier: "Cell_Ask_Qustion_text").</code> </p>
  
  <p>If you are using a storyboard you don't want to call this. It will overwrite what you have in your storyboard.**"</p>
  
  <p>Then I remove <code>registerClass</code>. But I get error as below</p>
  
  <blockquote>
    <p><code>init?(coder aDecoder: NSCoder)</code> of custom UICollectionViewCell , the
    error is <code>fatal error: init(coder:) has not been implemented: file
    /Users/nongmeng/Desktop/nongjitong/nongjitong/class/home/conreoller/ask
    question/YNAskQuestionTextCollectionViewCell.swift, line 48</code>.</p>
  </blockquote>
  
  <p>If I use code to add subViews， they show,Everything works fine. I wnat know Why.Why are subViews Of UICollectionViewCell in Interface Builder nil. Anyone can help me? Here is the example project. <a href="https://github.com/chengyanan/UICollectionView" rel="nofollow">https://github.com/chengyanan/UICollectionView</a></p>
  
  <p>This is viewController</p>
  
  <pre><code>    //MARK: life cycle
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.collectionView.registerClass(YNAskQuestionTextCollectionViewCell.self, forCellWithReuseIdentifier: "Cell_Ask_Qustion_text")
  
          self.collectionView.registerClass(YNAskQuestionImageCollectionViewCell.self , forCellWithReuseIdentifier: "Cell_Ask_Qustion_Image")
  
          self.collectionView.registerClass(YNAskQuestionLocationCollectionViewCell.self , forCellWithReuseIdentifier: "Cell_Ask_Qustion_Location")
  
          let flow = UICollectionViewFlowLayout()
  
          flow.minimumInteritemSpacing = 6
          flow.minimumLineSpacing = 16
  
          let size = CGSizeMake(self.view.frame.size.width, 100)
          print(size)  
          flow.itemSize = size
          flow.sectionInset = UIEdgeInsetsMake(0, 0, 30, 0)
          flow.scrollDirection = UICollectionViewScrollDirection.Vertical
          self.collectionView.collectionViewLayout = flow
  
          self.collectionView.backgroundColor = kRGBA(234, g: 234, b: 234, a: 1)
  
          self.collectionView.bounces = true
      }
  //MARK:UICollectionViewDataSource    
  func numberOfSectionsInCollectionView(collectionView: UICollectionView) -&gt; Int {
  
          return 3
      }
  
  
      func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return 1
      }
  
      func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
  
          if indexPath.section == 0 {
  
              let identify = "Cell_Ask_Qustion_text"
  
              let cell = collectionView.dequeueReusableCellWithReuseIdentifier(identify, forIndexPath: indexPath) as! YNAskQuestionTextCollectionViewCell
  
              return cell
  
          } else if indexPath.section == 2 {
  
              let identify = "Cell_Ask_Qustion_Location"
  
              let cell = collectionView.dequeueReusableCellWithReuseIdentifier(identify, forIndexPath: indexPath) as! YNAskQuestionLocationCollectionViewCell
  
              return cell
  
          }
  
  
          let identify = "Cell_Ask_Qustion_Image"
  
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier(identify, forIndexPath: indexPath) as! YNAskQuestionImageCollectionViewCell
  
          return cell
      }
  </code></pre>
  
  <p>this is custom UICollectionViewCell</p>
  
  <pre><code>import UIKit
  
  class YNAskQuestionTextCollectionViewCell: UICollectionViewCell {
  
      @IBOutlet weak var textView: UITextView!
  
      override init(frame: CGRect) {
          super.init(frame: frame)
  
          self.backgroundColor = UIColor.greenColor()
  
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
  }
  </code></pre>