title: UIPageControl Not Updating Even the value changed
body: <p>So I have <strong>MainViewController</strong> with a <strong>ContainerView</strong> embedded with a <code>PageViewController</code> this PageViewController have 2 pages, I've added a PageControl on top of the containerView, However trying to update the pages with the method</p>
  
  <pre><code> PageControl.currentPage = status.page
  </code></pre>
  
  <p>is not working. Plus I've printed the value initially and after swiping, the value of the currentpage changes, but the UI is not updating.</p>
  
  <p>Here's what I've done so far.</p>
  
  <p><strong>MainViewController</strong></p>
  
  <pre><code>   struct status {
      static var viewstat = ""
      static var bottomContainerHeightCon: CGFloat!
      static var containerHeightCon: CGFloat!
      static var bhbefore: CGFloat!
      static var chbefore: CGFloat!
      static var buttonstat = "false"
      static var page: Int = 0
  }
     @IBOutlet var pageControl: UIPageControl!
  
  
      override func viewDidLoad() {
      super.viewDidLoad()
  
      }
  
  
    func changePage() {
  
      view.layoutIfNeeded()
  }
  
  
     func configurePageControl() {
      // The total number of pages that are available is based on how many available colors we have.
  
      self.pageControl.numberOfPages = 2
      self.pageControl.currentPage = status.page
      self.pageControl.tintColor = UIColor.gray
      self.pageControl.pageIndicatorTintColor = UIColor.gray
      self.pageControl.currentPageIndicatorTintColor = UIColor.black   
  }
  </code></pre>
  
  <p><strong>PageViewController</strong></p>
  
  <pre><code>  override func viewDidLoad() {
      super.viewDidLoad()
  
      self.delegate = self
      self.dataSource = self
       configurePageControl()
      let page1: UIViewController! = storyboard?.instantiateViewController(withIdentifier: "QuestionsPage");
      let page2: UIViewController! = storyboard?.instantiateViewController(withIdentifier: "NeedPaymentPage");
      pages.append(page1)
      pages.append(page2)
      setViewControllers([page1], direction: UIPageViewControllerNavigationDirection.forward, animated: false, completion: nil)
  
  
  }
  
  
   func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
  
  
      let pageContentViewController = pageViewController.viewControllers![0]
      self.pageControl.currentPage = pages.index(of: pageContentViewController)!
  
  
    let currentIndex = pages.index(of: previousViewControllers.first!)!
    NeedDetailsController.status.page = currentIndex
      NeedController.changePage()
  
  
  }
  </code></pre>