Skip to content

Instantly share code, notes, and snippets.

@funkyboy
Last active April 1, 2016 17:28
Show Gist options
  • Select an option

  • Save funkyboy/a861ecde2ce84bbb373069c58bc3e1c5 to your computer and use it in GitHub Desktop.

Select an option

Save funkyboy/a861ecde2ce84bbb373069c58bc3e1c5 to your computer and use it in GitHub Desktop.
Safe but unreadable
func pageViewController(pageViewController: UIPageViewController,
viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? {
guard let viewControllerIndex = orderedViewControllers.indexOf(viewController) where viewControllerIndex > 0 else {
return nil
}
return orderedViewControllers[viewControllerIndex - 1]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment