title: Code for UICollectionView in creating a News feed on a mobile app
body: <p>I am a beginner at coding and I want to learn to design an iOS mobile app. I am learning by recreating apps already built through watching Youtube. I am currently recreating Facebook News feed. Below is the custom code I've learned. I'm stuck on the part where we build the cells and the sizes of them. Specifically, I am getting an error on: collectionView?.registerClass(FeedCell.self, forCellWithReuseIdentifier: cellId). It seems this was viable statement in previous Swift version but not for 3.0. Thank you for anyones help!</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import UIKit
  
  let cellId = "cellId"
  
  class FeedController: UICollectionViewController, UICollectionViewDelegateFlowLayout  {
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      navigationItem.title = "Facebook Feed"
  
  
      collectionView?.backgroundColor = UIColor(white: 0.95, alpha: 1)
  
      collectionView?.registerClass(FeedCell.self, forCellWithReuseIdentifier: cellId)
  
  
  }
  
  override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
      return 3
  }
  override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
      return collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath)
  }
  
  func collectionView(_collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
      return CGSize(width: view.frame.width, height: 50)
  
  
  
  }
  }
  
  class FeedCell: UICollectionViewCell {
  
      override init(frame: CGRect){
          super.init(frame: frame)
  
          setupViews()
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
      func setupViews()  {
  
      backgroundColor = UIColor.white
  </code></pre>