CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

VGSegment 1.0.4

VGSegment 1.0.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2019
SPMSupports SPM

Maintained by Vein.



VGSegment 1.0.4

  • By
  • VeinGuo

VGSegment

A segment menu with line animation

Swift build License MIT Platform pod

demo1

demo2

Requirements

  • Swift 3
  • iOS 8.0+
  • XCode 8

Usage

class ViewController: UIViewController, VGSegmentDelegate{

    override func viewDidLoad() {
        super.viewDidLoad()

        let rect = CGRect(x: 0, y: 250, width: view.frame.width, height: 45)
        let titles = ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"]
        
        let segment = VGSegment(frame: rect, titles: titles)
        segment.delegate = self
        view.addSubview(segment)
        
        var configuration: VGSegmentConfiguration {
            let configura = VGSegmentConfiguration()
            // TODO: configuration segment
            return configura
        }
        
        segment.configuration = configuration
    }
    
    func didSelectAtIndex(_ index: Int) {
        print("selectIndex:", index)
    }

}

Installation

  • Download VGSegment. Move to your project.

  • Cocoapods

platform :ios, ‘8.0’
use_frameworks!
pod "VGSegment"
  • Carthage
github "VeinGuo/VGSegment" ~> 1.0.1

Version

  • 1.0 Release (05/28/2017)
  • 1.0.1 Release (05/31/2017)
  • 1.0.2 fix horizontal and vertical autolayout