6 Commits

Author SHA1 Message Date
Hamza Ghazouani ef2d8ad615 Update the ReadMe and the podspec 2017-01-03 00:25:49 +01:00
Hamza Ghazouani dc6e27ce25 Update midPointCircular example 2017-01-03 00:19:19 +01:00
Hamza Ghazouani 6e36a72551 Change midPointValue from private to open 2017-01-03 00:13:25 +01:00
Hamza Ghazouani 1ade7ac71b Improve documentation 2017-01-03 00:08:28 +01:00
Hamza Ghazouani 78eae810db Update CHANGELOG.md 2016-11-16 23:37:09 +01:00
Hamza Ghazouani 14207d46aa Update README.md 2016-11-16 22:31:02 +01:00
7 changed files with 58 additions and 27 deletions
+5 -1
View File
@@ -1,7 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.
## [1.0.1](https://github.com/HamzaGhazouani/HGCircularSlider/releases/tag/1.0.0)
## [1.0.2](https://github.com/HamzaGhazouani/HGCircularSlider/releases/tag/1.0.2)
* Update the documentation
## [1.0.1](https://github.com/HamzaGhazouani/HGCircularSlider/releases/tag/1.0.1)
* remove warnings
@@ -253,7 +253,7 @@
<!--Example-->
<scene sceneID="stQ-nu-pyE">
<objects>
<viewController id="Npo-RV-git" sceneMemberID="viewController">
<viewController id="Npo-RV-git" customClass="OtherExampleViewController" customModule="HGCircularSlider_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="kg8-3T-le0"/>
<viewControllerLayoutGuide type="bottom" id="I5G-Jl-WfO"/>
@@ -332,6 +332,9 @@
</view>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<tabBarItem key="tabBarItem" title="Example" image="second" id="etG-Rt-332"/>
<connections>
<outlet property="circularSlider" destination="P7G-Iv-4Jm" id="tNc-8z-Gh2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="11N-ZE-qqz" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
@@ -7,6 +7,7 @@
//
import UIKit
import HGCircularSlider
extension CALayer {
@@ -21,10 +22,15 @@ extension CALayer {
class OtherExampleViewController: UIViewController {
@IBOutlet weak var circularSlider: MidPointCircularSlider!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
circularSlider.minimumValue = 0.0
circularSlider.maximumValue = 10.0
circularSlider.distance = 1.0
circularSlider.midPointValue = 5.0
}
override func didReceiveMemoryWarning() {
+1 -1
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'HGCircularSlider'
s.version = '1.0.2'
s.version = '1.0.3'
s.summary = 'Multiple Circular Sliders used to select a value from a continuous range of values.'
+13 -13
View File
@@ -11,7 +11,7 @@ import UIKit
/**
* A visual control used to select a single value from a continuous range of values.
* Can also be used like a circular progress view
* CircularSlider use the target-action mechanism to report changes made during the course of editing:
* CircularSlider uses the target-action mechanism to report changes made during the course of editing:
* ValueChanged, EditingDidBegin and EditingDidEnd
*/
@IBDesignable
@@ -20,28 +20,28 @@ open class CircularSlider: UIControl {
// MARK: Changing the Sliders Appearance
/**
* The color shown for the portion of the disk of slider that is filled. (between start and end values)
* The color shown for the selected portion of the slider disk. (between start and end values)
* The default value is a transparent color.
*/
@IBInspectable
open var diskFillColor: UIColor = UIColor.clear
/**
* The color shown for the portion of the disk of slider that is unfilled. (outside start and end values)
* The color shown for the unselected portion of the slider disk. (outside start and end values)
* The default value of this property is the black color with alpha = 0.3.
*/
@IBInspectable
open var diskColor: UIColor = UIColor.gray
/**
* The color shown for the portion of the slider that is filled. (between start and end values)
* The color shown for the selected track portion. (between start and end values)
* The default value of this property is the tint color.
*/
@IBInspectable
open var trackFillColor: UIColor = UIColor.clear
/**
* The color shown for the portion of the slider that is unfilled. (outside start and end values)
* The color shown for the unselected track portion. (outside start and end values)
* The default value of this property is the white color.
*/
@IBInspectable
@@ -64,7 +64,7 @@ open class CircularSlider: UIControl {
open var thumbLineWidth: CGFloat = 4.0
/**
* The radius of thumb
* The radius of the thumb
*
* The default value of this property is 13.0.
*/
@@ -72,7 +72,7 @@ open class CircularSlider: UIControl {
open var thumbRadius: CGFloat = 13.0
/**
* The color used to tint thumb
* The color used to tint the thumb
* Ignored if the endThumbImage != nil
*
* The default value of this property is the groupTableViewBackgroundColor.
@@ -81,8 +81,8 @@ open class CircularSlider: UIControl {
open var endThumbTintColor: UIColor = UIColor.groupTableViewBackground
/**
* The stroke highlighted color of end thumb
* The default value of this property is blue color
* The stroke highlighted color of the end thumb
* The default value of this property is blue
*/
@IBInspectable
open var endThumbStrokeHighlightedColor: UIColor = UIColor.blue
@@ -91,14 +91,14 @@ open class CircularSlider: UIControl {
* The color used to tint the stroke of the end thumb
* Ignored if the endThumbImage != nil
*
* The default value of this property is the red color.
* The default value of this property is red.
*/
@IBInspectable
open var endThumbStrokeColor: UIColor = UIColor.red
/**
* The image of the end thumb
* Clears any custom color you may have provided for end thumb.
* Clears any custom color you may have provided for the end thumb.
*
* The default value of this property is nil
*/
@@ -139,8 +139,8 @@ open class CircularSlider: UIControl {
/**
* The value of the endThumb (changed when the user change the position of the end thumb)
*
* If you try to set a value that is above the maximum value, the maximum value is set instead.
* If you try to set a value that is below the minimum value, the minimum value is set instead.
* If you try to set a value that is above the maximum value, the property automatically resets to the maximum value.
* And if you try to set a value that is below the minimum value, the property automatically resets to the minimum value.
*
* The default value of this property is 0.5
*/
@@ -58,12 +58,14 @@ open class MidPointCircularSlider: RangeCircularSlider {
*/
override open var distance: CGFloat {
didSet {
assert(distance >= 0, "The CustomCircularSlider works only with fixed distance between start and end points, so distance property should be > 0")
assert(distance >= 0, "The MidPointCircularSlider works only with fixed distance between start and end points, so distance property should be > 0")
}
}
/// The value of the mid point (between the start and end points)
fileprivate var midPointValue: CGFloat {
/**
* The value of the mid point (between the start and end points)
*/
open var midPointValue: CGFloat {
get {
return (endPointValue + startPointValue) / 2
}
+23 -7
View File
@@ -1,7 +1,7 @@
# HGCircularSlider
[![Twitter: @GhazouaniHamza](https://img.shields.io/badge/contact-@GhazouaniHamza-blue.svg?style=flat)](https://twitter.com/GhazouaniHamza)
[![CI Status](http://img.shields.io/travis/HamzaGhazouani/HGCircularSlider.svg?style=flat)](https://travis-ci.org/Hamza Ghazouani/HGCircularSlider)
[![CI Status](http://img.shields.io/travis/HamzaGhazouani/HGCircularSlider.svg?style=flat)](https://travis-ci.org/HamzaGhazouani/HGCircularSlider)
[![Version](https://img.shields.io/cocoapods/v/HGCircularSlider.svg?style=flat)](http://cocoapods.org/pods/HGCircularSlider)
[![License](https://img.shields.io/cocoapods/l/HGCircularSlider.svg?style=flat)](http://cocoapods.org/pods/HGCircularSlider)
[![Language](https://img.shields.io/badge/language-Swift-orange.svg?style=flat)]()
@@ -30,7 +30,7 @@ it, simply add the following line to your Podfile:
``` ruby
# Swift 3.0 - Xcode 8
pod 'HGCircularSlider', '~> 1.0.1'
pod 'HGCircularSlider', '~> 1.0.3'
# Swift 2.2 - Xcode 7.3.1 (Checkout Swift2_Xcode7.3 branche)
pod 'HGCircularSlider', '~> 0.1.2'
@@ -42,14 +42,30 @@ pod 'HGCircularSlider', '~> 0.1.2'
```
let circularSlider = CircularSlider(frame: myFrame)
```
OR
circularSlider.minimumValue = 0.0
circularSlider.maximumValue = 1.0
circularSlider.endPointValue = 0.2
```
OR
```
let circularSlider = RangeCircularSlider(frame: myFrame)
```
OR
circularSlider.startThumbImage = UIImage(named: "Bedtime")
circularSlider.endThumbImage = UIImage(named: "Wake")
let dayInSeconds = 24 * 60 * 60
circularSlider.maximumValue = CGFloat(dayInSeconds)
circularSlider.startPointValue = 1 * 60 * 60
circularSlider.endPointValue = 8 * 60 * 60
```
OR
```
let circularSlider = MidPointCircularSlider(frame: myFrame)
let circularSlider = MidPointCircularSlider(frame: myFrame)
circularSlider.minimumValue = 0.0
circularSlider.maximumValue = 10.0
circularSlider.distance = 1.0
circularSlider.midPointValue = 5.0
```
## Documentation
Full documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/HGCircularSlider/).<br/>