All Projects → TBXark → Tkdotsegment

TBXark / Tkdotsegment

Licence: mit
TKDotSegment is a segment with dot animation

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Tkdotsegment

Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (+751.46%)
Mutual labels:  cocoapods, carthage, ios-animation, widget
Pinterestsegment
A Pinterest-like segment control with masking animation.
Stars: ✭ 560 (+443.69%)
Mutual labels:  cocoapods, ios-animation, widget, segment
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift.
Stars: ✭ 2,965 (+2778.64%)
Mutual labels:  cocoapods, carthage, ios-animation
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+9638.83%)
Mutual labels:  cocoapods, carthage, ios-animation
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (+321.36%)
Mutual labels:  cocoapods, carthage, ios-animation
Tkrubberindicator
A rubber animation pagecontrol
Stars: ✭ 1,337 (+1198.06%)
Mutual labels:  cocoapods, carthage, ios-animation
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+1045.63%)
Mutual labels:  cocoapods, carthage, ios-animation
Networking
Easy HTTP Networking in Swift a NSURLSession wrapper with image caching support
Stars: ✭ 1,269 (+1132.04%)
Mutual labels:  cocoapods, carthage
Mbpopup
macOS status bar popups done right 😎
Stars: ✭ 89 (-13.59%)
Mutual labels:  cocoapods, carthage
Cardsstack
An awesome set of cards at your disposal ✌️ ⚡️
Stars: ✭ 97 (-5.83%)
Mutual labels:  cocoapods, carthage
Swiftcsvexport
Swift CSV Export is rich features framework and it helpful to read and write CSV in simple way.
Stars: ✭ 96 (-6.8%)
Mutual labels:  cocoapods, carthage
Freedom
The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
Stars: ✭ 85 (-17.48%)
Mutual labels:  cocoapods, carthage
Yndropdownmenu
✨ Awesome Dropdown menu for iOS with Swift 5.0
Stars: ✭ 1,259 (+1122.33%)
Mutual labels:  cocoapods, carthage
Xmlmapper
A simple way to map XML to Objects written in Swift
Stars: ✭ 90 (-12.62%)
Mutual labels:  cocoapods, carthage
Magnetic
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲
Stars: ✭ 1,252 (+1115.53%)
Mutual labels:  cocoapods, carthage
Quick
The Swift (and Objective-C) testing framework.
Stars: ✭ 9,303 (+8932.04%)
Mutual labels:  cocoapods, carthage
Hdwallet
Simple Swift library for creating HD cryptocurrencies wallets and working with crypto Coins/ERC20 tokens.
Stars: ✭ 80 (-22.33%)
Mutual labels:  cocoapods, carthage
Swiftyattributes
A Swifty API for attributed strings
Stars: ✭ 1,303 (+1165.05%)
Mutual labels:  cocoapods, carthage
Rdgliderviewcontroller Swift
Control for a floating view gliding over a ViewController Edit
Stars: ✭ 102 (-0.97%)
Mutual labels:  cocoapods, carthage
Puzzlemaker
Swift framework responsible for generating puzzles from the image
Stars: ✭ 99 (-3.88%)
Mutual labels:  cocoapods, carthage

TKDotSegment

A segment with dot animation

Swift Version License MIT CocoaPods CocoaPods Carthage compatible Support

Requirements

  • iOS 8.0+
  • Xcode 9.0
  • Swift 4.0

Installation

CocoaPods

You can use CocoaPods to install TKDotSegment by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'TKDotSegment'

To get the full benefits import TKDotSegment wherever you import UIKit

import UIKit
import TKDotSegment

Carthage

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

github "tbxark/TKDotSegment"

Manually

  1. Download and drop TKDotSegmentControl.swift in your project.
  2. Congratulations!

Usage example


let titles = ["First", "Second", "Third", "Fourth"]
let  segment = TKDotSegmentControl(titles: titles, frame: CGRect(x: 0, y: 0, width: 300, height: 40))
segment.dotColor = UIColor(red:1,  green:0.539,  blue:0.490, alpha:1)
segment.selectTitleColor = UIColor(red:1,  green:0.539,  blue:0.490, alpha:1)
segment.numOfDot = 4
segment.dotSpace = 6
segment.clickAction = { (index: Int, changeOffset: Bool) in
    print("Segment Select Index: \(index)")
}

Base

变量名 描述 Description
titles 选项标题 segment title
numOfDot 圆点数目 dot count
dotDiameter 圆点直径 dot diameter
dotSpace 圆点间距(负数则自动计算) dot space(automatic calculation when value is a positive number)
dotColor 圆点颜色 dot color
selectTitleColor 标题被选中时的颜色 The color of the title is selected
unSelectTitleColor 标题未被选中时的颜色 The color of the title is not selected
titleFont 标题字体 The font of the title
PLDot 圆点(可重写drawRect来自定义形状) Override drawRect to customize shape

1 . 改变 Index (change index)

    func changeSelectedIndex(index: Int, animate: Bool = true)

2 . 接受 Index 变化事件 (index value change event)

TKDotSegmentAction = (index: Int,  internaliFlag: Bool) -> Void

index 被选择的 index (selected index)

internaliFlag 是否内部点击触发的标志位 (event by click flag)

3 . 自定义圆点形状(Custom dot shape)

重写PLDotdrawRect 方法就可以了

Overwrite the drawRect of PLDot

Release History

  • 1.4.0 Support swift 4.0

  • 1.3.1 Support swift 3.0

  • 1.0.2 Complete basic functions, add Cocoapod and Carthage support

Contribute

We would love for you to contribute to TKDotSegment, 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].