11 Commits

Author SHA1 Message Date
Hamza Ghazouani 478fb36608 New Version: Fix Swift 3.1 warnings 2017-03-31 00:57:14 +02:00
Hamza Ghazouani 29823393ee Merge pull request #11 from frederik-jacques/master
fixed Swift 3.1 warnings
2017-03-29 09:57:39 +02:00
Frederik Jacques a7aa0c068e fixed Swift 3.1 warnings 2017-03-28 21:45:57 +02:00
Hamza Ghazouani 238de3030f Update CHANGELOG.md 2017-01-03 00:52:49 +01:00
Hamza Ghazouani bd17fd8a40 Merge pull request #5 from HamzaGhazouani/develop
Fix issue #4
2017-01-03 00:31:08 +01:00
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
10 changed files with 76 additions and 34 deletions
+14 -1
View File
@@ -1,7 +1,20 @@
# 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.1.0](https://github.com/HamzaGhazouani/HGCircularSlider/releases/tag/1.1.0)
* Fix Swift 3.1 warnings
## [1.0.3](https://github.com/HamzaGhazouani/HGCircularSlider/releases/tag/1.0.3)
* Change midPointValue from private to open
* Imporve the documentation
## [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
@@ -222,7 +222,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
@@ -511,6 +511,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 04EAC630898381E6412A72E4 /* Pods-HGCircularSlider_Example.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = HGCircularSlider/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -525,6 +526,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 9BA305BCC009CE17283FE799 /* Pods-HGCircularSlider_Example.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = HGCircularSlider/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -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.1.0'
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
*/
@@ -97,8 +97,8 @@ extension CGRect {
class CircularSliderHelper {
@nonobjc static let circleMinValue: CGFloat = 0
@nonobjc static let circleMaxValue: CGFloat = CGFloat(2 * M_PI)
@nonobjc static let circleInitialAngle: CGFloat = -CGFloat(M_PI_2)
@nonobjc static let circleMaxValue: CGFloat = CGFloat(2 * Double.pi)
@nonobjc static let circleInitialAngle: CGFloat = -CGFloat(Double.pi / 2)
/**
Convert angle from radians to degrees
@@ -108,7 +108,7 @@ class CircularSliderHelper {
- returns: degree value
*/
internal static func degrees(fromRadians value: CGFloat) -> CGFloat {
return value * 180.0 / CGFloat(M_PI)
return value * 180.0 / CGFloat(Double.pi)
}
/**
@@ -133,7 +133,7 @@ class CircularSliderHelper {
let angle = atan2(uv.determinant, uv.dotProduct)
// change the angle interval
let newAngle = (angle < 0) ? -angle : Float(2 * M_PI) - angle
let newAngle = (angle < 0) ? -angle : Float(2 * Double.pi) - angle
return CGFloat(newAngle)
}
@@ -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
}
+24 -8
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)]()
@@ -29,8 +29,8 @@ it, simply add the following line to your Podfile:
``` ruby
# Swift 3.0 - Xcode 8
pod 'HGCircularSlider', '~> 1.0.1'
# Swift 3.1 - Xcode 8.3
pod 'HGCircularSlider', '~> 1.1.0'
# 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/>