Latest 1.0.4
Homepage https://github.com/VeinGuo/VGSegment
License MIT License
Platforms ios 8.0, requires ARC
Authors

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

Latest podspec

{
    "name": "VGSegment",
    "version": "1.0.4",
    "summary": "A segment menu with line animation",
    "license": {
        "type": "MIT License",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/VeinGuo/VGSegment",
    "authors": {
        "VeinGuo": "https://github.com/VeinGuo"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/VeinGuo/VGSegment.git",
        "tag": "1.0.4"
    },
    "source_files": "VGSegment/**/*.{h,m,swift}",
    "requires_arc": true
}

Pin It on Pinterest

Share This