GitHub - ChiliLabs/CHIPageControl: A set of cool animated page controls written...
source link: https://github.com/ChiliLabs/CHIPageControl
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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 Labs.
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.
Recommend
-
107
party-party-party Turn a source image into an animated party emoji! This smiling emoji is pretty cool:
-
133
gitflowanimated - Git flow - Animated
-
144
readme.md
-
187
README.md Aseprite Copyright (C) 2001-2018 David Capello
-
54
README.md LibreSprite Copyright (C) 2001-2016 David Capello Copyright (C) 2016-2018 LibreSprite contributors Introduction LibreSprite
-
12
README.md Sweet Alert iOS Beautiful Animated custom Alert View inspired from javascript library SweetAler...
-
121
README.md CBFlashyTabBarController
-
121
README.md FaveButton
-
6
Using iMessage on your iPhone lets you do a lot more than just send texts. Some of the coolest features of iMessage are the animated effects that make texting more fun. You may have stumbled across these effects when wishing a fr...
-
7
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK