Giter Club home page Giter Club logo

g8sliderstep's Introduction

G8SliderStep

A custom range UISlider for iOS, written in Swift - Draggable, Tappable, @IBInspectable

How it works

Samples

Features:

  • Ready to use
  • Easy customization (font, colors, images, ticks...)
  • @IBInspectable
  • Tappable
  • Draggable
  • Titles support
  • Rotation support
  • Swift 2 support

ToDo:

  • Add CocoaPods support

Release note:

v1.1
  • .ValueChanged event invoked on slider tap.

How to use:

Manual

  • Import G8SliderStep.swift into you project
  • Add UISlider in you Storyboard file
  • Set the UISlider class to G8SliderStep
  • Configure your slider by storyboard or/and by code
  • Enjoy :)

####Customizable properties

    @IBInspectable var enableTap: Bool = true
    @IBInspectable var trackHeight: Float = 4
    @IBInspectable var trackColor: UIColor = UIColor.lightGrayColor()
    @IBInspectable var drawTicks: Bool = true
    @IBInspectable var stepTickWidth: Float = 15
    @IBInspectable var stepTickHeight: Float = 15
    @IBInspectable var stepTickColor: UIColor = UIColor.lightGrayColor()
    @IBInspectable var stepTickRounded: Bool = true
    @IBInspectable var unselectedFont: UIFont = UIFont.systemFontOfSize(13)
    @IBInspectable var selectedFont: UIFont = UIFont.systemFontOfSize(13)
    @IBInspectable var stepTitlesOffset: CGFloat = 1
    
    var customTrack: Bool = true
    
    ///Requireds
    var stepImages: [UIImage]?
    
    //Optionals
    var tickTitles: [String]?
    var tickImages: [UIImage]?

CocoaPods

TODO

Requirements

  • iOS 8.0+
  • Xcode 7.3.1+

Example Usage

By Code

@IBOutlet weak var sliderStep: G8SliderStep!

override func viewDidLoad() {
        super.viewDidLoad()

///G8SliderStep configuration
	sliderStep.stepImages = [UIImage(named:"star")!, UIImage(named:"heart")!, UIImage(named:"house")!]
	sliderStep.tickTitles = ["STAR", "HEART", "HOUSE"]
	let shape = UIImage(named:"shape")!
    sliderStep.tickImages = [shape, shape, shape]
    sliderStep.minimumValue = 2
    sliderStep.maximumValue = Float(sliderStep.stepImages!.count) + sliderStep.minimumValue - 1.0
    sliderStep.trackColor = UIColor.darkGrayColor()
    sliderStep.stepTickColor = UIColor.orangeColor()
    sliderStep.stepTickWidth = 30
    sliderStep.stepTickHeight = 30
    sliderStep.trackHeight = 10
    }

By Storyboard

Buy me a beer

If you like my work, please buy me a beer (tap the beer):

License

G8SliderStep is distributed under the MIT license (see LICENSE.md).

Contributors

Daniele Galiotto (founder) - iOS Freelance Developer - www.g8production.com

g8sliderstep's People

Watchers

 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.