     addConstraints()
     view.bringSubviewToFront(bottomLineView)
     goTo(startPage)
+  }
+
+  public override func viewDidAppear(animated: Bool) {
+    super.viewDidAppear(animated)
+
+    for subview in view.subviews {
+      if subview is UIPageControl {
+        pageControl = subview as? UIPageControl
+      }
+    }
   }
 }
 

    return view
    }()

  public convenience init(_ pages: [UIViewController],
    transitionStyle: UIPageViewControllerTransitionStyle = .Scroll,
    navigationOrientation: UIPageViewControllerNavigationOrientation = .Horizontal,

            title = viewController.title
          }

          if let pageControl = pageControl {
            pageControl.currentPage = currentIndex
          }

          pagesDelegate?.pageViewController(self, setViewController: pages[currentIndex], atPage: currentIndex)
      }
    }
