Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ef2d8ad615 | |||
| dc6e27ce25 | |||
| 6e36a72551 | |||
| 1ade7ac71b | |||
| 78eae810db | |||
| 14207d46aa |
+5
-1
@@ -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() {
|
||||
|
||||
@@ -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.'
|
||||
|
||||
|
||||
|
||||
@@ -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 Slider’s 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
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# HGCircularSlider
|
||||
|
||||
[](https://twitter.com/GhazouaniHamza)
|
||||
[](https://travis-ci.org/Hamza Ghazouani/HGCircularSlider)
|
||||
[](https://travis-ci.org/HamzaGhazouani/HGCircularSlider)
|
||||
[](http://cocoapods.org/pods/HGCircularSlider)
|
||||
[](http://cocoapods.org/pods/HGCircularSlider)
|
||||
[]()
|
||||
@@ -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/>
|
||||
|
||||
Reference in New Issue
Block a user