GithubHelp home page GithubHelp logo

lbzspinner's Introduction

Platform Language

LBZSpinner (Supports Swift 3)

Simple Spinner with dropdown-list for iOS (like android)

Demo

View live demo in Appetize : https://appetize.io/app/m4gbf5ghpyh4bw4vpdcjxgk218?device=iphone5s&scale=75&orientation=portrait&osVersion=9.2

Installation / Usage

Import LBZSpinner.swift in your project (or use example project)

Create LBZSpinner in code :

let spinnerCode = LBZSpinner(frame: CGRect(x: 90,y: 30,width: 180,height: 45))
self.view.addSubview(spinnerCode)
Configure Spinner Style :
spinnerCode.decoratedSpinner(UIColor.purpleColor(), lineColor: UIColor.brownColor(), text: "Choose value")

(Use nil parameter for default value)

Configure Dropdown-list Style :
spinnerCode.decoratedDropDownList(UIColor.lightGrayColor(), textColor: UIColor.redColor(), withStroke: true, strokeSize: 5, strokeColor: nil)

(Use nil parameter for default value)

Create LBZSpinner in IB :

In Storyboard, place a simple UIView in your ViewController

Set "Custom class" in "Identity inspector" with LBZSpinner :

Img

Configure style dropdowlist and spinner :

Img

LBZSpinner show in viewcontroller :

Img

Configure Dropdown-list value :

let listCode = ["Books","Video","Streaming","Download","Upload"]
spinnerCode.updateList(listCode)

Configure Delegate

Use LBZSpinnerDelegate for event return :

Declare use LBZSpinnerDelegate :
class ViewController: UIViewController, LBZSpinnerDelegate 
Set Spinner delegate :
spinnerCode.delegate = self
Event return method :
func spinnerChoose(spinner:LBZSpinner, index:Int,value:String) {
    print("Spinner : \(spinner) : { Index : \(index) - \(value) }")
}
Get/Set index :

Get actual selected index :

var index = spinnerBot.selectedIndex

if no selected value :

if spinnerBot.selectedIndex == LBZSpinner.INDEX_NOTHING {
    print("NOTHING VALUE")
}

Set actual selected index :

spinnerBot.changeSelectedIndex(1)

Images example

Example 1 :

Img

Img

Example 2 :

Img

Img

Example of dip type and LeBzul type

spinner demo

Author

Guillian Drouin, [email protected]

Dip kasyap, [email protected] (dip type added)

License

LBZSpinner is available under the Apache license. See the LICENSE file for more info.

lbzspinner's People

Contributors

lebzul avatar dipkasyap avatar

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.