Skip to content

Commit

Permalink
- Demo gif uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketan Chopda authored and Ketan Chopda committed Oct 10, 2018
1 parent 699f8a3 commit 0ab09ce
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 4 deletions.
Binary file added CircularSliderDemo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 104 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,104 @@
# SSCircularSlider
# SSCircularSlider


A simple and powerful circular ring slider, written in swift and fully customizable.

[![Swift Version][swift-image]][swift-url]
[![Build Status][travis-image]][travis-url]
[![License][license-image]][license-url]
[![Platform][platform-image]][platform-url]
[![PRs Welcome][PR-image]][PR-url]

![Alt text](https://github.com/simformsolutions/SSCircularSlider/blob/master/CircularRingSiderStoryBoard.png)

# Features!
- Circular ring slider
- Customizable slider color
- Costmize slider knob
- Customizable sider end point buttons
- Adjust slider by editing center label
- Dynammic values of slider
- CocoaPods

# Requirements
- iOS 10.0+
- Xcode 9+

# Installation
**CocoaPods**

- You can use CocoaPods to install SSSpinnerButton by adding it to your Podfile:

use_frameworks!
pod 'SSCircularSlider'

-
import UIKit
import SSCircularSlider

**Manually**
- Download and drop **SSCircularSlider** folder in your project.
- Congratulations you are done with installation!

# Usage example

- In the storyboard add a UIView and change its class to SSCircularSlider
- ![Alt text](https://github.com/simformsolutions/SSCircularSlider/blob/master/CircularRingSiderStoryBoard.png)

**SetValues**

let arrValues: [Int] = [Int](0...30)
circularRingSlider.setArrayValues(labelValues: arrValues, currentIndex: indexOfValue)

**SetInitialValue**

let arrValues: [Int] = [Int](0...30)
indexOfValue = 0
circularRingSlider.setValues(initialValue: arrValues[indexOfValue].toCGFloat(), minValue: arrValues[0].toCGFloat(), maxValue: arrValues[arrValues.count-1].toCGFloat())

**SetKnobImage**

circularRingSlider.setKnobOfSlider(knobSize: 40, knonbImage: UIImage(named: "iconKnobRed")!)

**SetTextFieldDelegate**

circularRingSlider.setValueTextFieldDelegate(viewController: self)

**SetRingWidth**

circularRingSlider.outerRingWidth = 18
circularRingSlider.innerRingWidth = 18

**SetBackgroundColorOfAllButtons**

circularRingSlider.setBackgroundColorOfAllButtons(startPointColor: UIColor.red, endPointColor: UIColor.lightGray, knobColor: UIColor.white)

**SetEndPointImages**

circularRingSlider.setEndPointsImage(startPointImage: iconMinus, endPointImage: iconPlus)

**SetProgressLayerColor**

circularRingSlider.setProgressLayerColor(colors: [UIColor.red.cgColor, UIColor.red.cgColor])

# Contribute
- We would love you for the contribution to SSCircularSlider, check the LICENSE file for more info.

# Meta
- Distributed under the MIT license. See LICENSE for more information.


[swift-image]:https://img.shields.io/badge/swift-4.0-orange.svg
[swift-url]: https://swift.org/
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/dbader/node-datadog-metrics
[codebeat-image]: https://codebeat.co/assets/svg/badges/C-ffb83f-7198e9a1b7ad7f73977b0c9a5c7c3fffbfa25f262510e5681fd8f5a3188216b0.svg
[codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com
[platform-image]:https://img.shields.io/cocoapods/p/LFAlertController.svg?style=flat
[platform-url]:http://cocoapods.org/pods/LFAlertController
[cocoa-image]:https://img.shields.io/cocoapods/v/EZSwiftExtensions.svg
[cocoa-url]:https://img.shields.io/cocoapods/v/LFAlertController.svg
[PR-image]:https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[PR-url]:http://makeapullrequest.com
4 changes: 2 additions & 2 deletions SSCircularSlider/Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kUh-Re-JKe" customClass="SSCircularRingSlider" customModule="SSCircularSlider" customModuleProvider="target">
<rect key="frame" x="50" y="206" width="275" height="275"/>
<rect key="frame" x="50" y="30" width="275" height="275"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="275" id="3SU-04-pRU"/>
Expand All @@ -31,7 +31,7 @@
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="kUh-Re-JKe" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="QZb-Eg-yM3"/>
<constraint firstItem="kUh-Re-JKe" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="UNy-Rm-kaX"/>
<constraint firstItem="kUh-Re-JKe" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="10" id="q3f-I8-Yea"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ open class SSCircularRingSlider: UIView {
var knonbImage = UIImage(named: "iconKnobRed")
var startPointImage = UIImage(named: "iconMinusRed")
var endPointImage = UIImage(named: "iconPlusRed")
var labelFont = UIFont.boldSystemFont(ofSize: 23)
var labelFont = UIFont.boldSystemFont(ofSize: 40)
var gradientColors: [CGColor] = [UIColor.red.cgColor, UIColor.red.cgColor] {
didSet {
if gradientColors.count < 2 {
Expand Down

0 comments on commit 0ab09ce

Please sign in to comment.