tbxark
TKRubberIndicator
Swift

A rubber animation pagecontrol

Last updated Jun 29, 2026
1.5k
Stars
167
Forks
7
Issues
0
Stars/day
Attention Score
65
Language breakdown
Swift 96.4%
Ruby 3.6%
β–Έ Files click to expand
README

TKRubberIndicator

A rubber animation pagecontrol

Xcode 9.0+ iOS 8.0+ Swift 4.0+ Build Status CocoaPods Carthage compatible License MIT

Requirements

  • Swift 4.0
  • iOS 8.0+
  • Xcode 9.0

Installation

CocoaPods

You can use CocoaPods to install TKRubberPageControl by adding it to your Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'TKRubberPageControl'

To get the full benefits import TKRubberPageControl wherever you import UIKit

swift
import UIKit
import TKRubberPageControl

Carthage

Create a Cartfile that lists the framework and run carthage update. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/TKRubberPageControl.framework to an iOS project.
github "tbxark/TKRubberIndicator"

Manually

  • Download and drop
    .swift
    in your project.
  • Congratulations!

Usage example

You can use closure or Target-Action to listen control event

class ViewController: UIViewController {

let page = TKRubberIndicator(frame: CGRectMake(100, 100, 200, 100), count: 6)

override func viewDidLoad() { super.viewDidLoad()

self.view.backgroundColor = UIColor(red:0.553, green:0.376, blue:0.549, alpha:1) page.center = self.view.center page.valueChange = {(num) -> Void in print("Closure : Page is \(num)") } page.addTarget(self, action: "targetActionValueChange:", forControlEvents: UIControlEvents.ValueChanged) self.view.addSubview(page)

page.numberOfpage = 2 }

@IBAction func pageCountChange(sender: UISegmentedControl) { page.numberOfpage = (sender.selectedSegmentIndex + 1) * 2 } func targetActionValueChange(page:TKRubberIndicator){ print("Target-Action : Page is \(page.currentIndex)") }

override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } }

Base

|Key | Usage| | |---|---|---| |smallBubbleSize|ζœͺ选中小球尺寸|unselect small ball size| |mainBubbleSize|选中倧球尺寸|select big ball size| |bubbleXOffsetSpace|小球间距|The distance between the ball| |bubbleYOffsetSpace|纡向间距|bubble Y Offset Space| |animationDuration|εŠ¨η”»ζ—Άι•Ώ|animation duration| |backgroundColor|θƒŒζ™―ι’œθ‰²|control background color| |smallBubbleColor|ε°ηƒι’œθ‰²|unselect small ball color| |mainBubbleColor|ε€§ηƒι’œθ‰²|select big ball color|

Release History

  • 1.4.0
Swift 4.0
  • 1.3.1
Bug Fixed
  • 1.3.0
Support Swift 3.0
  • 1.0.5
Fix bug, add Cocoapod and Carthage support
  • 1.0.4
Complete basic functions

Contribute

We would love for you to contribute to TKRubberPageControl, check the `LICENSE file for more info.

Meta

TBXark – @tbxark – tbxark@outlook.com

Distributed under the MIT license. See LICENSE` for more information.

https://github.com/TBXark

[swift-image]:https://img.shields.io/badge/swift-3.0-orange.svg [swift-url]: https://swift.org/ [license-image]: https://img.shields.io/badge/License-MIT-blue.svg [license-url]: LICENSE [travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square [travis-url]: https://travis-ci.org/dbader/node-datadog-metrics [codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad [codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com

Β© 2026 GitRepoTrend Β· tbxark/TKRubberIndicator Β· Updated daily from GitHub