title: Detect UIPageControl page change
body: <p>I want to Add a <code>UIPageController</code> inside <code>UICollectionViewCell</code>. I created a custom nib file with a <code>collectionViewCell</code> inside. Inside the cell I added a <code>UIPageControl</code>.</p>
  <pre><code>@IBOutlet weak var pageControl: UIPageControl!
       
  override func awakeFromNib() {
      super.awakeFromNib()
        
      self.isUserInteractionEnabled = true
      pageControl.isUserInteractionEnabled = true
      self.backgroundColor = UIColor.darkGray
      setupPageControl()
  }
  
  private func setupPageControl() {
      
      pageControl.numberOfPages = 7
      pageControl.translatesAutoresizingMaskIntoConstraints = false
      pageControl.currentPageIndicatorTintColor = UIColor.orange
      pageControl.pageIndicatorTintColor = UIColor.lightGray.withAlphaComponent(0.8)
  }
  </code></pre>
  <p>How can I detect the page change? Also the dots are in the middle of the view, is it possible to put them on the middle?</p>
  <p><a href="https://i.stack.imgur.com/b01Ju.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b01Ju.png" alt="enter image description here" /></a></p>