All Projects → TBXark → Pinterestsegment

TBXark / Pinterestsegment

Licence: mit
A Pinterest-like segment control with masking animation.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Pinterestsegment

Tkdotsegment
TKDotSegment is a segment with dot animation
Stars: ✭ 103 (-81.61%)
Mutual labels:  cocoapods, ios-animation, widget, segment
Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (+56.61%)
Mutual labels:  cocoapods, ios-animation, coreanimation, widget
Tkrubberindicator
A rubber animation pagecontrol
Stars: ✭ 1,337 (+138.75%)
Mutual labels:  cocoapods, ios-animation, coreanimation
Sizeslidebutton
A fun Swift UIControl for picking a size
Stars: ✭ 46 (-91.79%)
Mutual labels:  cocoapods, ios-animation
Iosproject
iOS project of collected some demos for iOS App, use Objective-C
Stars: ✭ 5,357 (+856.61%)
Mutual labels:  ios-animation, coreanimation
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 (+110.71%)
Mutual labels:  cocoapods, ios-animation
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+1691.25%)
Mutual labels:  cocoapods, ios-animation
Mevfloatingbutton
An iOS drop-in UITableView, UICollectionView and UIScrollView superclass category for showing a customizable floating button on top of it.
Stars: ✭ 301 (-46.25%)
Mutual labels:  cocoapods, ios-animation
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift.
Stars: ✭ 2,965 (+429.46%)
Mutual labels:  cocoapods, ios-animation
Rhplaceholder
Show pleasant loading view for your users 😍
Stars: ✭ 238 (-57.5%)
Mutual labels:  cocoapods, ios-animation
Wobbly
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.
Stars: ✭ 150 (-73.21%)
Mutual labels:  cocoapods, ios-animation
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (-30.18%)
Mutual labels:  cocoapods, coreanimation
Mevhorizontalcontacts
An iOS UICollectionViewLayout subclass to show a list of contacts with configurable expandable items.
Stars: ✭ 358 (-36.07%)
Mutual labels:  cocoapods, ios-animation
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (-22.5%)
Mutual labels:  cocoapods, ios-animation
Nanopop
🍦 Minimalistic, small, positioning engine. Build for high-performance, minimal footprint and maximum control over positioning behavior.
Stars: ✭ 520 (-7.14%)
Mutual labels:  widget
Ninapagerview
Stars: ✭ 545 (-2.68%)
Mutual labels:  segment
Ppgetaddressbook
一句代码极速获取按A~Z分组精准排序的通讯录联系人 OC版( 已处理姓名所有字符的排序问题 )
Stars: ✭ 519 (-7.32%)
Mutual labels:  cocoapods
Mynlp
一个生产级、高性能、模块化、可扩展的中文NLP工具包。(中文分词、平均感知机、fastText、拼音、新词发现、分词纠错、BM25、人名识别、命名实体、自定义词典)
Stars: ✭ 519 (-7.32%)
Mutual labels:  segment
Xcake
🍰 Describe Xcode projects in a human readable format and (re)generate one on demand.
Stars: ✭ 549 (-1.96%)
Mutual labels:  cocoapods
Sablurimageview
You can use blur effect and it's animation easily to call only two methods.
Stars: ✭ 538 (-3.93%)
Mutual labels:  cocoapods

PinterestSegment

A Pinterest-like segment control with masking animation.

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

Requirements

  • iOS 8.0+
  • Xcode 9.0
  • Swift 4.0

Installation

CocoaPods

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

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

To get the full benefits import PinterestSegment wherever you import UIKit

import UIKit
import PinterestSegment

Carthage

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

github "tbxark/PinterestSegment"

Manually

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

Usage example

let  style = PinterestSegmentStyle()

style.indicatorColor = UIColor(white: 0.95, alpha: 1)
style.titleMargin: CGFloat = 15
style.titlePendingHorizontal: CGFloat = 14
style.titlePendingVertical: CGFloat = 14
style.titleFont = UIFont.boldSystemFont(ofSize: 14)
style.normalTitleColor = UIColor.lightGray
style.selectedTitleColor = UIColor.darkGray

let segment = PinterestSegment(frame: CGRect(x: 20, y: 200, width: w - 40, height: 40), style: style, titles: ["Everything", "Geek", "Humor", "Art", "Food", "Home", "DIY", "Wemoent' Style", "Man's Style", "Beauty", "Travel"])

segment.valueChange = { index in
  // Do something here
}

You can also add icon for each title, Just like the blow demo gif

@IBOutlet weak var ibSegment: PinterestSegment!

var titles = [PinterestSegment.TitleElement]()
for i in 1...7 {
    guard let image = UIImage(named: "icon_\(i)"),
    let selectedImage = image.maskWithColor(color: ibSegment.style.selectedTitleColor),
    let normalImage = image.maskWithColor(color: ibSegment.style.normalTitleColor)  else { continue }
    titles.append(PinterestSegment.TitleElement(title: "Face-\(i)", selectedImage: selectedImage, normalImage: normalImage))
}
ibSegment.setRichTextTitles(titles)

Article

   Fix automaticallyAdjustsScrollViewInsets bug in PinterestSegment https://tbxark.com/2016/12/08/2016-12-08-Swift-Pinterst/

Release History

  • 1.2.0 support swift 4.0

  • 1.0.1 fix bug

  • 1.0.0 first commit

Contribute

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