Giter Club home page Giter Club logo

vgsegment's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.