CHIPageControl

A set of cool animated page controls written in Swift to replace boring UIPageControl.

Github stars Tracking Chart

CHIPageControl

CHIPageControl is a set of cool animated page controls to replace boring UIPageControl.
We were inspired by Jardson Almeida dribbble shot and implemented a few more page controls.

Made with ❤️ by Chili.

Overview

Requirements

  • iOS 8.0+
  • Xcode 8+
  • Swift 3

Installation

Manually

Just add the CHIPageControl folder to your project.

CocoaPods

use CocoaPods with Podfile:

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'

Carthage

use Carthage with Cartfile

github "ChiliLabs/CHIPageControl" ~> 0.1.3

Usage

? Storyboards

Just drop UIView and set its class to be one of CHIPageControls.

? Code

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

// 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

//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.

pageControl.enableTouchEvents = true

Delegate

Implement the CHIBasePageControlDelegate to catch touch events.

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 for details.

Main metrics

Overview
Name With OwnerChiliLabs/CHIPageControl
Primary LanguageSwift
Program languageRuby (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2017-03-13 12:15:14
Pushed At2023-05-22 02:43:41
Last Commit At2022-06-28 10:47:23
Release Count17
Last Release Name0.2.1 (Posted on )
First Release Name0.0.1 (Posted on )
用户参与
Stargazers Count3.4k
Watchers Count45
Fork Count264
Commits Count43
Has Issues Enabled
Issues Count52
Issue Open Count17
Pull Requests Count20
Pull Requests Open Count5
Pull Requests Close Count11
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private