STPageView
A paging view.
STPageView is a paging view. You can use it to layout multiple view controllers, switching through gestures. And it supports both horizontal and vertical directions.
Requirements
- iOS 8.0 or later (For iOS 8.0 before, maybe it can work, but I have not tested.)
- ARC
- Swift 5.0
Installation
STPageView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'STPageView'
Usage
Import headers in your source files
In the source files where you need to use the library, import the header file:
import STPageView
Initialize STPageView
Use the following function to initialize the STAlertController, then add it to your view and set up the Auto Layout:
let pageView = STPageView(controllers: [controllerA, controllerB])
Implement STPageViewDelegate
Implement STPageViewDelegate, you can using some STPageView delegate functions:
func pageView(_ pageView: STPageView, didSelect controller: UIViewController) {
print("PageView didSelect \(controller), index \(pageView.controllers.index(of: controller)!)")
}
Author
Suta, [email protected]