MaterialPageControl is designed to be used in conjunction with a scroll view. You must implement three scrollview delegate methods (-scrollViewDidScroll, -scrollViewDidEndDecelerating, and -scrollViewDidEndScrollingAnimation) and must forward them to the page control just like this:
MaterialPageControl
Swift version of material-components-ios/PageControl which is influenced by Material Design specifications for animations and layout.
Demo
Installation
CocoaPods
PageViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
Swift Package Manager
To integrate using Swift Package Manager, add the following as a dependency to your Package.swift:
Usage
You can initialize MaterialPageControl programatically or through interface builder and always must setup its numberOfPages property:
MaterialPageControl is designed to be used in conjunction with a scroll view. You must implement three scrollview delegate methods (-scrollViewDidScroll, -scrollViewDidEndDecelerating, and -scrollViewDidEndScrollingAnimation) and must forward them to the page control just like this:
If you want to have the page control default tap gesture behaviour you should implement it like this:
Author
Alonso Alvarez, alonso.alvarez.dev@gmail.com
License
MaterialPageControl is available under the MIT license. See the LICENSE file for more info.