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: about 1 month 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-14T03:49:23.000Z (about 1 year ago)
- Last Synced: 2024-07-04T22:39:49.498Z (5 months ago)
- Topics: carthage, cocoapods, instagram, ios, swift, uipagecontrol
- Language: Swift
- Homepage:
- Size: 28 MB
- Stars: 798
- Watchers: 18
- Forks: 110
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - FlexiblePageControl - A flexible UIPageControl like Instagram. (Libs / UI)
- awesome-swift - FlexiblePageControl - A flexible UIPageControl like Instagram. (Libs / UI)
- awesome-cocoa - FlexiblePageControl
- awesome-swift - FlexiblePageControl - A flexible UIPageControl like Instagram. ` 📝 2 years ago` (UI [🔝](#readme))
- awesome-swift - FlexiblePageControl - A flexible UIPageControl like Instagram. (Libs / UI)
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