All Projects → tapptitude → Ttsegmentedcontrol

tapptitude / Ttsegmentedcontrol

Licence: mit
An elegant, animated and customizable segmented control for iOS created by Tapptitude

Programming Languages

swift
15916 projects
swift3
66 projects

Projects that are alternatives of or similar to Ttsegmentedcontrol

Cyltabbarcontroller
[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
Stars: ✭ 6,605 (+1302.34%)
Mutual labels:  xcode, cocoapods, uikit
Tweetextfield
Lightweight set of text fields with nice animation and functionality. 🚀 Inspired by https://uimovement.com/ui/2524/input-field-help/
Stars: ✭ 421 (-10.62%)
Mutual labels:  cocoapods, uikit, interface-builder
Gradientcircularprogress
Customizable progress indicator library in Swift
Stars: ✭ 407 (-13.59%)
Mutual labels:  xcode, cocoapods, customizable
Everlayout
Reusable, downloadable, up-datable iOS layouts
Stars: ✭ 103 (-78.13%)
Mutual labels:  xcode, cocoapods, interface-builder
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (+104.46%)
Mutual labels:  xcode, cocoapods, uikit
Bfkit
BFKit is a collection of useful classes and categories to develop Apps faster.
Stars: ✭ 811 (+72.19%)
Mutual labels:  xcode, cocoapods, uikit
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (-16.99%)
Mutual labels:  xcode, cocoapods, uikit
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (-7.43%)
Mutual labels:  xcode, cocoapods, interface-builder
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-83.86%)
Mutual labels:  xcode, cocoapods, uikit
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+2173.04%)
Mutual labels:  xcode, cocoapods, uikit
Swiftuikitview
Easily use UIKit views in your SwiftUI applications. Create Xcode Previews for UIView elements
Stars: ✭ 398 (-15.5%)
Mutual labels:  xcode, uikit
Skyfloatinglabeltextfield
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.
Stars: ✭ 3,907 (+729.51%)
Mutual labels:  cocoapods, interface-builder
Acknowlist
Acknowledgements screen displaying a list of licenses, for example from CocoaPods dependencies.
Stars: ✭ 392 (-16.77%)
Mutual labels:  cocoapods, uikit
Squishbutton
A button that squishes when pressed. As seen in the Clips app.
Stars: ✭ 401 (-14.86%)
Mutual labels:  xcode, uikit
Jyradarchart
an iOS open source Radar Chart implementation
Stars: ✭ 419 (-11.04%)
Mutual labels:  xcode, cocoapods
Tlyshynavbar
Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars!
Stars: ✭ 3,780 (+702.55%)
Mutual labels:  cocoapods, uikit
Agimagepickercontroller
Stars: ✭ 424 (-9.98%)
Mutual labels:  xcode, cocoapods
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITab…
Stars: ✭ 4,152 (+781.53%)
Mutual labels:  xcode, cocoapods
Dnspageview
一个纯 Swift 的轻量级、灵活且易于使用的 pageView
Stars: ✭ 461 (-2.12%)
Mutual labels:  xcode, cocoapods
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (-7.86%)
Mutual labels:  cocoapods, customizable

TTSegmentedControl

Platform Version License Twitter

About

An elegant, animated and customizable segmented control for iOS.

This project is maintained by Tapptitude, a mobile app development agency specialized in building high-quality iOS and Android mobile apps, for startups and brands alike. A lively team of skilled app developers and app designers based in Europe, we provide full-stack mobile app development services to entrepreneurs looking to innovate on mobile.

Features:

  • Variable number of items
  • Animated transition
  • Bounce animation
  • Fully configurable (color, gradient, shadow, corner radius)
  • Designable into Interface Builder

Requirements

  • iOS 8.0+
  • Xcode 7.3+

Installation

CocoaPods

Swift 5.0

pod 'TTSegmentedControl', '~>0.4.9'

Swift 4.2

pod 'TTSegmentedControl', '~>0.4.8'

Swift 4.0

pod 'TTSegmentedControl', '~>0.4.6'

Swift 3.X

pod 'TTSegmentedControl', '~>0.3'

Swift 2.x

pod 'TTSegmentedControl', '0.1.1'

Carthage

github "tapptitude/TTSegmentedControl"

Manually

Add the TTSegmentedControl.swift file to your project.

Usage

  • Programatic:
let segmentedControl = TTSegmentedControl()
segmentedControl.allowChangeThumbWidth = false
segmentedControl.frame = CGRect(x: 50, y: 200, width: 100, height: 50)
segmentedControl.didSelectItemWith = { (index, title) -> () in
    print("Selected item \(index)")
}
view.addSubview(segmentedControl)
  • Interface Builder:

Add a UIView and set it's class to TTSegmentedControl. You can customize the control directly from the interface builder.

How to customize?

Checkout the playground and see how to implement and customize the SegmentedControl.

pod try TTSegmentedControl

In order to customize the segmented control you'll have to edit it's properties.

segmentedControl.defaultTextColor = UIColor.blackColor()
segmentedControl.selectedTextColor = UIColor.whiteColor()
segmentedControl.thumbGradientColors = [UIColor.redColor(), UIColor.blueColor()]
segmentedControl.useShadow = true

You can add image instead of title.

// ask segmented control to initialize all elements internally
segmentedControl.layoutSubviews()
        
let imageAttachment = NSTextAttachment()
imageAttachment.image = image
imageAttachment.bounds = CGRect(x: 0, y: -5, width: 20, height: 20)
        
let attributes = NSAttributedString(attachment: imageAttachment)
        
segmentedControl.changeAttributedTitle(attributes, selectedTile: attributes, atIndex: atIndex)

Or combine them.

// ask segmented control to initialize all elements internally
segmentedControl.layoutSubviews()
        
let imageAttachment = NSTextAttachment()
imageAttachment.image = image
imageAttachment.bounds = CGRect(x: 0, y: -5, width: 20, height: 20)
        
let attributes = segmentedControl.attributedDefaultTitles.first?.mutableCopy() as! NSMutableAttributedString
attributes.append(NSAttributedString(attachment: imageAttachment))
        
let selectedAttributes = segmentedControl.attributedSelectedTitles.first?.mutableCopy() as! NSMutableAttributedString
selectedAttributes.append(NSAttributedString(attachment: imageAttachment))
        
segmentedControl.changeAttributedTitle(attributes, selectedTile: selectedAttributes, atIndex: atIndex)

Contribution

Feel free to Fork, submit Pull Requests or send us your feedback and suggestions!

License

TTSegmentedControl is available under the MIT license. See the LICENSE file for more info.

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