-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from warchimede/fix/spm
Fix: SPM support
- Loading branch information
Showing
8 changed files
with
313 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import WARangeSlider | ||
import UIKit | ||
|
||
class ViewController: UIViewController { | ||
let rangeSlider1 = RangeSlider(frame: CGRect.zero) | ||
let rangeSlider2 = RangeSlider(frame: CGRect.zero) | ||
let rangeSlider1 = RangeSlider(frame: CGRect.zero) | ||
let rangeSlider2 = RangeSlider(frame: CGRect.zero) | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
// Do any additional setup after loading the view, typically from a nib. | ||
rangeSlider2.trackHighlightTintColor = UIColor.red | ||
rangeSlider2.curvaceousness = 0.0 | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
// Do any additional setup after loading the view, typically from a nib. | ||
rangeSlider2.trackHighlightTintColor = UIColor.red | ||
rangeSlider2.curvaceousness = 0.0 | ||
|
||
view.addSubview(rangeSlider1) | ||
view.addSubview(rangeSlider2) | ||
view.addSubview(rangeSlider1) | ||
view.addSubview(rangeSlider2) | ||
|
||
rangeSlider1.addTarget(self, action: #selector(ViewController.rangeSliderValueChanged(_:)), for: .valueChanged) | ||
} | ||
rangeSlider1.addTarget(self, action: #selector(ViewController.rangeSliderValueChanged(_:)), for: .valueChanged) | ||
} | ||
|
||
override func viewDidLayoutSubviews() { | ||
let margin: CGFloat = 20.0 | ||
let width = view.bounds.width - 2.0 * margin | ||
rangeSlider1.frame = CGRect(x: margin, y: margin + 100, width: width, height: 31.0) | ||
rangeSlider2.frame = CGRect(x: margin + 20, y: 5 * margin + 100, | ||
width: width - 40, height: 40) | ||
} | ||
override func viewDidLayoutSubviews() { | ||
let margin: CGFloat = 20.0 | ||
let width = view.bounds.width - 2.0 * margin | ||
rangeSlider1.frame = CGRect(x: margin, y: margin + 100, width: width, height: 31.0) | ||
rangeSlider2.frame = CGRect(x: margin + 20, y: 5 * margin + 100, | ||
width: width - 40, height: 40) | ||
} | ||
|
||
@objc func rangeSliderValueChanged(_ rangeSlider: RangeSlider) { | ||
print("Range slider value changed: (\(rangeSlider.lowerValue) , \(rangeSlider.upperValue))") | ||
} | ||
@objc func rangeSliderValueChanged(_ rangeSlider: RangeSlider) { | ||
print("Range slider value changed: (\(rangeSlider.lowerValue) , \(rangeSlider.upperValue))") | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.