QPage view controller is lightweight View Controller similar to UIPageViewController, but with better delegates and reusable UIVIewControllers.
func pageViewController(_ pageViewController: QPageViewController, controllerAfter controller: UIViewController?) -> UIViewController? {
let retController:SingleViewController = reusableController()
guard let controller = controller as? SingleViewController, let currentModel = controller.model else {
retController.model = model[0]
return retController
}
retController.model = self.nextModel(currentModel: currentModel)
return retController
}
func pageViewController(_ pageViewController: QPageViewController, controllerBefore controller: UIViewController?) -> UIViewController? {
let retController:SingleViewController = reusableController()
guard let controller = controller as? SingleViewController, let currentModel = controller.model else {
retController.model = model[0]
return retController
}
retController.model = self.prevModel(currentModel: currentModel)
return retController
}
- Swift 4.0
- Xcode 9
- iOS 10.0+
The easiest way to integrate this framework in your project is to use Carthage.
- Add
github "Qase/QPageViewController"
to yourCartfile
. - Run
carthage bootstrap
. - Drag either the
QPageViewController.xcodeproj
or theQPageViewController.framework
into your project/workspace and link your target against theQPageViewController.framework
. - Make sure the framework gets copied to your application bundle.
Another option for integrating this framework is to use Git submodules.
QPageViewController
is released under the MIT License.