title: How to add PageControl inside UICollectionView Image Scrolling
body: <p>I have <code>UICollectionView</code> Horizontal Image listing codes. I want to add <code>PageControl</code> when scrolling images will shows, I added pagecontrol selector and <code>IBOutlet</code> but how can I integrate it between <code>UICollecitonView</code>? </p>
  
  <p>My codes are below:</p>
  
  <pre><code> class  ViewController: UIViewController,  UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
  
  
      @IBOutlet weak var View : DesignableView!
  
  
      @IBOutlet var collectionView: UICollectionView!
      @IBOutlet var collectionViewLayout: UICollectionViewFlowLayout!
  
      @IBOutlet open weak var pageControl: UIPageControl? {
          didSet {
              pageControl?.addTarget(self, action: #selector(ViewController.pageChanged(_:)), for: .valueChanged)
          }
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
           pageControl?.numberOfPages = 11
  
  
      }
  
  
      func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return 11;
      }
  
  
  
  
      func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let cell: ImageCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "ImageCollectionViewCell", for: indexPath) as! ImageCollectionViewCell
          cell.label.text = "Cell \(indexPath.row)"
          cell.backgroundImageView.image = UIImage(named: "Parallax \(indexPath.row + 1)")
  
          // Parallax cell setup
          cell.parallaxTheImageViewScrollOffset(self.collectionView.contentOffset, scrollDirection: self.collectionViewLayout.scrollDirection)
          return cell
      }
  
  
  
      @IBAction open func pageChanged(_ sender: UIPageControl) {
  
          print(sender.currentPage)
  
  
      }
  
  
  
  
      // MARK: Delegate
  
      func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
          return collectionView.bounds.size;
      }
  
      // MARK: Scrolling
  
      func scrollViewDidScroll(_ scrollView: UIScrollView) {
          // Parallax visible cells
          for cell: ImageCollectionViewCell in collectionView.visibleCells as! [ImageCollectionViewCell] {
              cell.parallaxTheImageViewScrollOffset(self.collectionView.contentOffset, scrollDirection: self.collectionViewLayout.scrollDirection)
          }
      }
  
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  
  
  }
  </code></pre>