title: Swift: is it okay to add constraints to UICollectionview?
body: <p>I have this class</p>
  
  <pre><code>class HomePage: UIViewController,UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate
  </code></pre>
  
  <p>And in this class i have a lot of UIViews.One of which is <code>tabView</code>.Now i want to add my <code>collectionView</code> to the bottom of <code>tabView</code>,how can i do that? Here is my `collectionView</p>
  
  <pre><code>    var flowLayout = UICollectionViewFlowLayout()
  
      let collectionView = UICollectionView(frame: CGRect(x:0,y:500,width:self.view.frame.size.width,height:100   ), collectionViewLayout: flowLayout)
      collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: cellId)
      collectionView.delegate = self
      collectionView.dataSource = self
      collectionView.backgroundColor = .red`
  </code></pre>
  
  <p>And constraints to <code>tabView</code></p>
  
  <pre><code>    tabView.topAnchor.constraint(equalTo: profileInfWrapper.bottomAnchor).isActive = true
      tabView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
      tabView.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.size.width/4).isActive = true
      tabView.heightAnchor.constraint(equalToConstant: 80).isActive = true
  </code></pre>