Question: Regarding to this [tutorial by AppCoda about how to implement a app with UIPageViewController](http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/) I'd like to use a custom page control element on top of the pages instead of at the bottom. 

When I just put a page control element on top of the single views which will be displayed, the logical result is that the control elements scrolls with the page view away from the screen. 

How is it possible to put the control element on top of the views so the page views are full screen (like with an image) so the user can see the views underneath the fixed control element?

I attached an example screenshot - credits to [AppCoda and Path](http://www.appcoda.com/uipageviewcontroller-tutorial-intro/):

![enter image description here](https://i.stack.imgur.com/pR5KH.jpg)

Answer: 
After further investigation and searching [I found a solution](https://stackoverflow.com/a/19140401/66414), also on stackoverflow.

The key is the following message to send to a custom `UIPageControl` element:

```
[self.view bringSubviewToFront:self.pageControl];

```

[The AppCoda tutorial is the foundation for this solution](http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/):

Add a `UIPageControl` element on top of the `RootViewController` - the view controller with the arrow.

Create a related `IBOutlet` element in your `ViewController.m`. 

In the `viewDidLoad` method you should then add the following code as the last method you call after adding all subviews.

```
[self.view bringSubviewToFront:self.pageControl];

```

To assign the current page based on the pageIndex of the current content view you can add the following to the `UIPageViewControllerDataSource` methods:

```
- (UIPageViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
{
    // ...
    index--;
    [self.pageControl setCurrentPage:index];

    return [self viewControllerAtIndex:index];
}

- (UIPageViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
{
    // ...
    index++;
    [self.pageControl setCurrentPage:index];

    // ...
    return [self viewControllerAtIndex:index];
}

```
You have to implement a custom `UIPageControl` and add it to the view. As others have mentioned, `view.bringSubviewToFront(pageControl)` must be called.

I have an [example](http://samwize.com/2016/03/08/using-uipageviewcontroller-with-custom-uipagecontrol/) of a view controller with all the code on setting up a custom `UIPageControl` (in storyboard) with `UIPageViewController`

There are 2 methods which you need to implement to set the current page indicator.

```
func pageViewController(pageViewController: UIPageViewController, willTransitionToViewControllers pendingViewControllers: [UIViewController]) {
    pendingIndex = pages.indexOf(pendingViewControllers.first!)
}

func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
    if completed {
        currentIndex = pendingIndex
        if let index = currentIndex {
            pageControl.currentPage = index
        }
    }
}

```