GithubHelp home page GithubHelp logo

carabina / shsliderswitch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iamshezad/shsliderswitch

0.0 1.0 0.0 357 KB

SHSliderSwitch is a simple lightweight library to implement an animated slider switch.

License: MIT License

Ruby 2.80% Objective-C 2.45% Swift 94.75%

shsliderswitch's Introduction

SHSliderSwitch

SHSliderSwitch is a simple lightweight library to implement an animated slider switch.

Swift 4.0 License Platform

Installation

Just drag and drop the SHSliderSWitch.swift file from SHSliderSWitch folder to your project.

Cocoapods

pod 'SHSliderSwitch'

Usage

  1. Just drag and drop an view in storyboard and set view class to SHSliderSWitch.

  1. How to configure:

-- can configure using IBInspectable.

-- configure manually.

  //Current value of the switch. Defaults to 0.
  sliderSwitch.value = 0.0
  
  /// Minimum value. Must be less than maximumValue. Defaults to 0.
  sliderSwitch.minimumValue = 0.0
  
  /// Maximum value. Must be more than minimumValue. Defaults to 100.
  sliderSwitch.maximumValue = 100.0
  
  /// Increment value  in switch. Defaults to 1.
  sliderSwitch.stepValue = 1
  
  /// Text color of the circular label. Defaults to white.
  sliderSwitch.labelTextColor = UIColor.white
  
  /// Background color of the circular label. Defaults to lighter white.
  sliderSwitch.labelBackgroundColor = UIColor.blue
  
  /// Font of the circular label. Defaults to Futura-Medium, 14.0 points in size.
  sliderSwitch.labelFont = UIFont(name: "Futura-Medium", size: 14.0)
  
  /// Border width of the switch and circular label's layer. Defaults to 0.0.
  sliderSwitch.borderColor = 0.0
  
  /// Color of the border of the switch and circular label's layer. Defaults to clear color.
  sliderSwitch.borderColor = UIColor.clear
  
  /// Font of the buttons. Defaults to Futura-Bold, 20.0 points in size.
  sliderSwitch.buttonsFont = UIFont(name: "Futura-Bold", size: 20.0)
  
  /// Text color of the buttons. Defaults to white.
  sliderSwitch.buttonsTextColor = UIColor.white
        

Requirements

  • iOS 11.0+

Example

Download the Sample project.

Contact

Mail me @: [email protected]

Acknowledge

Inspired by GMStepper

License

SHSliderSwitch is available under the MIT license. See the LICENSE file for more info.

shsliderswitch's People

Contributors

iamshezad avatar

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.