STPageView 0.0.7

STPageView 0.0.7

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2019
SPMSupports SPM

Maintained by Suta.



  • By
  • Suta

STPageView

Language Platform Version License

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.

STPageViewPreview01

STPageViewPreview02

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]

License

MIT license.