Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shima11/flexiblepagecontrol
A flexible UIPageControl like Instagram.
https://github.com/shima11/flexiblepagecontrol
carthage cocoapods instagram ios swift uipagecontrol
Last synced: 6 days ago
JSON representation
A flexible UIPageControl like Instagram.
- Host: GitHub
- URL: https://github.com/shima11/flexiblepagecontrol
- Owner: shima11
- License: mit
- Created: 2017-04-05T05:52:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-14T03:49:23.000Z (over 1 year ago)
- Last Synced: 2024-12-29T13:12:34.468Z (13 days ago)
- Topics: carthage, cocoapods, instagram, ios, swift, uipagecontrol
- Language: Swift
- Homepage:
- Size: 28 MB
- Stars: 800
- Watchers: 17
- Forks: 108
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FlexiblePageControl
A flexible UIPageControl like Instagram.[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/hsylife/SwiftyPickerPopover)
![Swift 4.2.x](https://img.shields.io/badge/Swift-4.2.x-orange.svg)
[![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)# OverView
![](demo.gif)
# Install
### Carthage
For Installing with Carthage, add it to your `Cartfile`.
````
github "shima11/FlexiblePageControl"
````
````
$ carthage update
````### CocoaPods
For installing with CocoaPods, add it to your `Podfile`.
```
pod "FlexiblePageControl"
```
```
$ pod update
```# Usage
````
let pageControl = FlexiblePageControl()
pageControl.numberOfPages = 10
view.addSubview(pageControl)
````### Customize
````
// color
pageControl.pageIndicatorTintColor = color1
pageControl.currentPageIndicatorTintColor = color2// size
let config = FlexiblePageControl.Config(
displayCount: 7,
dotSize: 6,
dotSpace: 4,
smallDotSizeRatio: 0.5,
mediumDotSizeRatio: 0.7
)pageControl.setConfig(config)
````### Update page
````
func scrollViewDidScroll(_ scrollView: UIScrollView) {
pageControl.setProgress(contentOffsetX: scrollView.contentOffset.x, pageWidth: scrollView.bounds.width)
}
````
or
````
pageControl.setCurrentPage(at: page)
````# Licence
Licence MIT