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.
- iOS 8.0 or later (For iOS 8.0 before, maybe it can work, but I have not tested.)
- ARC
- Swift 5.0
STPageView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'STPageView'
In the source files where you need to use the library, import the header file:
import 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, you can using some STPageView delegate functions:
func pageView(_ pageView: STPageView, didSelect controller: UIViewController) {
print("PageView didSelect \(controller), index \(pageView.controllers.index(of: controller)!)")
}
Suta, [email protected]