Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ChiliLabs/CHIPageControl
A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io
https://github.com/ChiliLabs/CHIPageControl
cocoapods ibdesignable ibinspectable ios ipad iphone pagecontrol pageindicator pager storyboard swift swift3 ui
Last synced: 3 months ago
JSON representation
A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io
- Host: GitHub
- URL: https://github.com/ChiliLabs/CHIPageControl
- Owner: ChiliLabs
- License: mit
- Created: 2017-03-13T12:15:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T02:43:41.000Z (over 1 year ago)
- Last Synced: 2024-04-23T23:35:17.071Z (6 months ago)
- Topics: cocoapods, ibdesignable, ibinspectable, ios, ipad, iphone, pagecontrol, pageindicator, pager, storyboard, swift, swift3, ui
- Language: Swift
- Homepage:
- Size: 2.36 MB
- Stars: 3,326
- Watchers: 46
- Forks: 254
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - CHIPageControl - A set of cool animated page controls to replace boring UIPageControl. (UI / UIPageControl)
- awesome-swift - CHIPageControl - A set of cool animated page controls to replace boring UIPageControl. (Libs / UI)
- awesome-cocoa - CHIPageControl
- awesome-swift - CHIPageControl - A set of cool animated page controls to replace boring UIPageControl. (Libs / UI)
- awesome-ios - CHIPageControl
- awesome-ios-star - CHIPageControl - A set of cool animated page controls to replace boring UIPageControl. (UI / UIPageControl)
- fucking-awesome-swift - CHIPageControl - A set of cool animated page controls to replace boring UIPageControl. (Libs / UI)
- awesome-swift - CHIPageControl - A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io ` 📝 a year ago` (UI [🔝](#readme))
README
# CHIPageControl
CHIPageControl is a set of cool animated page controls to replace boring UIPageControl.
We were inspired by [Jardson Almeida dribbble shot](https://dribbble.com/shots/2578447-Page-Control-Indicator-Transitions-Collection) and implemented a few more page controls.Made with ❤️ by [Chili Labs](https://chililabs.io).
## Overview
## Requirements
* iOS 8.0+
* Xcode 8+
* Swift 3## Installation
### Manually
Just add the `CHIPageControl` folder to your project.
### CocoaPods
use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'CHIPageControl', '~> 0.1.3'# individual page control
pod 'CHIPageControl/Aji'
pod 'CHIPageControl/Aleppo'
pod 'CHIPageControl/Chimayo'
pod 'CHIPageControl/Fresno'
pod 'CHIPageControl/Jalapeno'
pod 'CHIPageControl/Jaloro'
pod 'CHIPageControl/Paprika'
pod 'CHIPageControl/Puya'
```
### Carthageuse [Carthage](https://github.com/Carthage/Carthage) with Cartfile
```ogdl
github "ChiliLabs/CHIPageControl" ~> 0.1.3
```### Swift Package Manager
The [Swift Package Manager](https://www.swift.org/package-manager/) is a tool for managing the distribution of Swift code.
Add the following to your `Package.swift` file:
```
dependencies: [
.package(url: "https://github.com/ChiliLabs/CHIPageControl.git", .branch("master"))
]
```
And then build your project
```
$ swift build
```## Usage
### 🎨 Storyboards
Just drop UIView and set its class to be one of CHIPageControls.
### 💻 Code
``` swift
let pageControl = CHIPageControlAji(frame: CGRect(x: 0, y:0, width: 100, height: 20))
pageControl.numberOfPages = 4
pageControl.radius = 4
pageControl.tintColor = .red
pageControl.currentPageTintColor = .green
pageControl.padding = 6
```### Adding multiple tintColors
``` swift
// The size of the array needs to match the numberOfPages or it will throw an fatal error
pageControl.tintColors = [UIColor.black, UIColor.yellow, UIColor.black, UIColor.black]// or
// If it is the first one, it will fill all colors with the selected tintColor and then replace the colors with the desired one
pageControl.insertTintColor(UIColor.yellow, position: 1)
```### Updating progress
``` swift
//update dynamically
pageControl.progress = 0.5//set progress with animation
pageControl.set(progress: 2, animated: true)
```### Touch events
You can hear touch events in any of the page indicators.
``` swift
pageControl.enableTouchEvents = true
```### Delegate
Implement the `CHIBasePageControlDelegate` to catch touch events.
```swift
func didTouch(pager: CHIBasePageControl, index: Int)
```### Page Controls 🌶️🌶️🌶️
CHIPageControlAji
CHIPageControlAleppo
CHIPageControlChimayo
CHIPageControlFresno
CHIPageControlJalapeno
CHIPageControlJaloro
CHIPageControlPaprika
CHIPageControlPuya
## License
CHIPageControl is released under the MIT license. See [LICENSE](./LICENSE) for details.