Skip to content

Commit

Permalink
Rename removesHighlighLineOnTouchesEnded
Browse files Browse the repository at this point in the history
#79 used removesHighlighLineOnTouchesEnded, better name is hideHighlightLineOnTouchEnd
  • Loading branch information
gpbl committed Jan 6, 2018
1 parent 9050e61 commit 56b1b17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions Example/SwiftChart/BasicChartViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BasicChartViewController: UIViewController, ChartDelegate {
// Draw the chart selected from the TableViewController

chart.delegate = self

switch selectedChart {
case 0:

Expand Down Expand Up @@ -74,8 +74,6 @@ class BasicChartViewController: UIViewController, ChartDelegate {
default: break;

}


}

// Chart delegate
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Some tips for debugging an hidden chart:
* `delegate` – the delegate for listening to touch events.
* `highlightLineColor` – color of the highlight line.
* `highlightLineWidth` – width of the highlight line.
* `removesHighlighLineOnTouchesEnded` (default `false`) – if true will hide the highlight line as soon as you stop swiping over the chart.
* `hideHighlightLineOnTouchEnd` (default `false`) – hide the highlight line when the touch event ends (e.g. when stop swiping over the chart).
* `gridColor` – the grid color.
* `labelColor` – the color of the labels.
* `labelFont` – the font used for the labels.
Expand Down
9 changes: 5 additions & 4 deletions Source/Chart.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ open class Chart: UIControl {
Width for the highlight line.
*/
open var highlightLineWidth: CGFloat = 0.5

/**
Removes highlight line when touches end.
*/
open var removesHighlighLineOnTouchesEnded = false
Hide the highlight line when touch event ends
*/
open var hideHighlightLineOnTouchEnd = false

/**
Alpha component for the area's color.
Expand Down Expand Up @@ -760,7 +761,7 @@ open class Chart: UIControl {

override open func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
handleTouchEvents(touches, event: event)
if self.removesHighlighLineOnTouchesEnded {
if self.hideHighlightLineOnTouchEnd {
if let shapeLayer = highlightShapeLayer {
shapeLayer.path = nil
}
Expand Down

0 comments on commit 56b1b17

Please sign in to comment.