From 0a37f3f95ebb373b873bc214797ce11d99941c3c Mon Sep 17 00:00:00 2001 From: Sereivoan Yong Date: Fri, 2 Jul 2021 14:42:19 +0700 Subject: [PATCH] Add `barSidePadding` --- Sources/RangeSeekSlider.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/RangeSeekSlider.swift b/Sources/RangeSeekSlider.swift index 8dc379a..546b27d 100644 --- a/Sources/RangeSeekSlider.swift +++ b/Sources/RangeSeekSlider.swift @@ -211,6 +211,13 @@ import UIKit } } + /// Set padding on left and right side of slider line (default 16.0) + @IBInspectable open var barSidePadding: CGFloat = 16.0 { + didSet { + updateLabelPositions() + } + } + /// The label displayed in accessibility mode for minimum value handler. If not set, the default is empty String. @IBInspectable open var minLabelAccessibilityLabel: String? @@ -470,7 +477,6 @@ import UIKit } private func updateLineHeight() { - let barSidePadding: CGFloat = 16.0 let yMiddle: CGFloat = (frame.height - lineHeight) / 2.0 let lineLeftSide: CGPoint = CGPoint(x: barSidePadding, y: yMiddle) let lineRightSide: CGPoint = CGPoint(x: frame.width - barSidePadding,