A rubber animation pagecontrol

Overview

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

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

  1. Download and drop TKRubberPageControl.swift in your project.
  2. 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[email protected]

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

https://github.com/TBXark

Comments
  • Carthage failed importing

    Carthage failed importing

    ▶ carthage update
    *** Please update to the latest Carthage version: 0.24.0. You currently are on 0.22.0
    *** Cloning TKRubberPageControl
    A shell task (/usr/bin/env git clone --bare --quiet https://github.com/tbxark/TKRubberPageControl.git /Users/Fooar/Library/Caches/org.carthage.CarthageKit/dependencies/TKRubberPageControl) failed with exit code 128:
    fatal: could not read Username for 'https://github.com': terminal prompts disabled
    

    @TBXark

    opened by renege 1
  • Properties should be public

    Properties should be public

    Hi, this looks great, but I'm having trouble installing it with Cocoapods. The main issue is that the project seems to be missing access control.

    I can see that currently, in master, the class and the style struct are public, but the properties are not. This means that we can't set them after init and we can't listen for value changes.

    opened by fjcaetano 1
  • How to apply a shadow?

    How to apply a shadow?

    Firstly, thank you for a great library.

    How can I apply a shadow to the TKRubberPageControl? Now the view looks like is on the same level of the background. Thanks

    opened by westlinkin 0
  • currentIndex doesnt change

    currentIndex doesnt change

    When setting the current index programmatically, the current index is not reflected in the UI. There is no animation change or anything.

    Line 218

    if index == currentIndex { return }
    

    is always true

    opened by anthonycastelli 1
  • Can't change the controller on click the button.

    Can't change the controller on click the button.

    Can we change the controller on my own custom button click. because i need this stuff in my app, but i didn't find such function from which i can change the position of the controller. It only change on tap. Please make it on button click also.

    opened by hassanshahid94 0
  • current index problem

    current index problem

       page.numberOfpage = 3
       page.currentIndex = 2
    

    if i set number of page and currentIndex it doesnt show current index and also when i set so there is issue in desing simulator screen shot - iphone se - 2017-10-04 at 15 56 16

    opened by ghimireprashant 0
Releases(1.4.0)
Owner
TBXark
Gopher, Swift programmer
TBXark
自定义 iOS14 PageControl 控件新功能

ZQEndlessPageControl 功能 自定义 iOS14 PageControl 控件新功能 ☑️ 最大展示个数 ☑️ 设置大小、间隙、背景颜色 ☑️ 设置边框大小,颜色 ☑️ 设置大、中、小,三种状态的缩放系数 ☑️ 设置背景图 ☑️ 效果 使用 配置对象 public struct Z

zhengzeqin 10 Aug 10, 2022
This is PageControl Component for OS X. Inspired by UIPageControl and BFPageControl

NSPageControl This is PageControl Component for OS X. Inspired by UIPageControl and BFPageControl. Demo ##Installation NSPageControl supports multiple

Kohei Tabata 13 Jan 19, 2022
Simple Interface Core Animation. Run type-safe animation sequencially or parallelly

Simple Interface Core Animation Sica can execute various animations sequentially or parallelly. Features Animation with duration and delay parallel /

CATS Open Source Softwares 1k Nov 10, 2022
SwiftUI, peek scrolling animation and card tapped animation, using GeometryReader

SwiftUI, peek scrolling animation and card tapped animation, using GeometryReader, follow the livestream tutorial by MengTo.

Terry Kuo 4 Jun 10, 2022
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Mostafa Abdellateef 7 Jan 2, 2023
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan Glavaš 9 Nov 5, 2022
Repository for the first challenge of the SwiftUI Animation Challenges. Create the likeable now playing animation from the Spotify app.

Repository for the first challenge of the SwiftUI Animation Challenges. Create the likeable now playing animation from the Spotify app.

null 18 Aug 16, 2022
ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation

ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation. Demo Requirements iOS 9.0+ Xcode 8 Insta

Yansong Li 775 Dec 7, 2022
A DSL to make animation easy on iOS with Swift.

This project is highly inspired by JHChainableAnimations, If you project is developed with Objective-C, use JHChainableAnimations instead. With DKChai

Draven 1.9k Dec 9, 2022
Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers

Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers. It's magic. Features Animate a

Robert-Hein Hooijmans 1.3k Nov 17, 2022
Elegant SVG animation kit for swift

Elephant This is SVG animation presentation kit for iOS. Example You can run example app. Please open Example-iOS/Elephant-iOS.xcworkspace! Usage You

Kazumasa Shimomura 127 Dec 14, 2022
Gemini is rich scroll based animation framework for iOS, written in Swift.

Overview What is the Gemini? Gemini is rich scroll based animation framework for iOS, written in Swift. You can easily use GeminiCollectionView, which

Shohei Yokoyama 3k Dec 27, 2022
Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.

Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.

IBAnimatable 8.6k Jan 2, 2023
A Fast Animation Engine with an Intuitive API

Kinieta An Animation Engine for iOS with an Intuitive API and Readable Code! (Written in Swift 4.0.) Why another? I decided to build an Animation Engi

Michael Michailidis 44 Sep 22, 2022
🎨 Gradient animation effect like Instagram

Pastel ?? Gradient animation effect like Instagram Example override func viewDidLoad() { super.viewDidLoad() let pastelView = PastelView(fram

Cruz 3.4k Jan 1, 2023
Pulse animation for iOS written with Swift.

Pulsator Pulse animation for iOS written with Swift. Great For: Pulses of Bluetooth, BLE, beacons (iBeacon), etc. Map Annotations Installation CocoaPo

Shuichi Tsutsumi 1.3k Jan 6, 2023
A fantastic Physical animation library for swift

A fantastic Physical animation library for swift(Not Just Spring !!!), it is base on UIDynamic and extension to it, friendly APIs make you use it or c

August 2.9k Jan 4, 2023
YapAnimator is your fast and friendly physics-based animation system

YapAnimator is your fast and friendly physics-based animation system. YapAnimator was built with ease-of-use in mind, keeping you sane and your design

Yap Studios 1.9k Dec 6, 2022