title: PageControl in collectionView swift
body: <p>I created a control page for my collectionView of 12 cells. I would like these cells to be distributed in 2 pages, in a grid of 3 columns and 2 rows. but with the current code the 12 cells are arranged on one row. how can I fix it? i think i have to change the layout of my collection, but i can't change anything from the storyboard. this is my code for pageControl if it helps.</p>
  
  <pre><code> var thisWidth: CGFloat = 0
  
      override func awakeFromNib() {
          super.awakeFromNib()
  
          thisWidth = CGFloat(self.view.frame.width)
          cartaCollectionView.delegate = self
          cartaCollectionView.dataSource = self
  
          pageControl.hidesForSinglePage = true
      }
  
      func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
          pageControl.currentPage = Int(scrollView.contentOffset.x) / Int(scrollView.frame.width)
      }```
  </code></pre>