---
title: "#158: Better UIPageViewControllers with Pages 📖"
url: https://littlebitesofcocoa.com/158-better-uipageviewcontrollers-with-pages
author: Jake Marsh
date: 2015-12-30
published: 2015-12-30
topics: ["Libraries","UIKit"]
description: "Today we're looking at another great library from Hyper called Pages. It's essentially a convenience wrapper on top of UIPageViewController (previously..."
---

# #158: Better UIPageViewControllers with Pages 📖

By Jake Marsh, December 30, 2015. HTML: https://littlebitesofcocoa.com/158-better-uipageviewcontrollers-with-pages

Today we're looking at another great library from [Hyper](https://github.com/hyperoslo) called [Pages](https://github.com/hyperoslo/Pages). It's essentially a convenience wrapper on top of **UIPageViewController** (previously covered in [Bite #55](https://littlebitesofcocoa.com/55)).  It makes working with **paged view controllers** a bit more friendly. Let's begin:

We'll start by composing a _PagesController_. This will be the **view controller** that contains the other **view controllers**:

``` swift
let pagesVC = PagesController([shipsVC, stormtroopersVC])
    
pagesVC.enableSwipe = true
pagesVC.showBottomLine = false
pagesVC.showPageControl = false
```

We use a few **properties** to configure the look and feel and behavior we want, then we can use the **view controller** like normal.

_Pages_ has some awesome convenience **functions** for programmatically scrolling to pages:

``` swift
pagesVC.goTo(1) // go to page at index 1
pagesVC.next() // go forward 1 page
pagesVC.previous() // go back 1 page
```

We can also easily add **view controller** pages on the fly:

``` swift
pagesVC.add([resistanceBasesVC, jediTemplesVC])
```

Last but not least, _Pages_ is quite configurable offering **properties** for customizing not only the look and feel, but also behaviors such as whether or not changing **view controllers** affects the title shown in **navigation bar** of the **navigation controller** containing the pages.

More info about _Pages_ can be found at [git.io/pages](http://git.io/pages)
