Sharing my version of Brian's solution for changing the indicator bars after a tap:
```
if let index = controllers.firstIndex(of: currentController) {
let tapLocation = gesture.location(in: view)
let delta = tapLocation.x > view.frame.width / 2 ? 1 : -1
let nextIndex = max(0, min(controllers.count - 1, index + delta))
if index == nextIndex { return }
let nextController = controllers[nextIndex]
let direction: NavigationDirection = delta == 1 ? .forward : .reverse
delegate?.pageViewController?(self, willTransitionTo: [nextController])
setViewControllers([nextController], direction: direction, animated: true) { (done) in
if not(done) { return }
self.delegate?.pageViewController?(self, didFinishAnimating: true, previousViewControllers: self.controllers, transitionCompleted: done)
}
}
```
The big difference is that my version calls two methods on the `UIPageViewControllerDelegate` which just so happens to be `self` (`delegate = self`) , thus avoiding the copy/paste.