Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Indentation on Example ViewController #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ViewController: UIViewController {

@IBOutlet var label: UILabel!
@IBOutlet var slider: Slider!
@IBOutlet var sliderWithImages: Slider!
@IBOutlet var sliderWithImages: Slider!

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -41,24 +41,24 @@ class ViewController: UIViewController {
self?.setLabelHidden(false, animated: true)
}

sliderWithImages.attributedTextForFraction = { fraction in
let formatter = NumberFormatter()
formatter.maximumIntegerDigits = 3
formatter.maximumFractionDigits = 0
let string = formatter.string(from: (fraction * 800 + 100) as NSNumber) ?? ""
return NSAttributedString(string: string, attributes: [.font: UIFont.systemFont(ofSize: 12, weight: .bold), .foregroundColor: UIColor.black])
}
sliderWithImages.setMinimumImage(UIImage(named: "banana"))
sliderWithImages.setMaximumImage(UIImage(named: "cake"))
sliderWithImages.imagesColor = UIColor.white.withAlphaComponent(0.8)
sliderWithImages.setMinimumLabelAttributedText(NSAttributedString(string: "", attributes: labelTextAttributes))
sliderWithImages.setMaximumLabelAttributedText(NSAttributedString(string: "", attributes: labelTextAttributes))
sliderWithImages.fraction = 0.5
sliderWithImages.shadowOffset = CGSize(width: 0, height: 10)
sliderWithImages.shadowBlur = 5
sliderWithImages.shadowColor = UIColor(white: 0, alpha: 0.1)
sliderWithImages.contentViewColor = UIColor.purple
sliderWithImages.valueViewColor = .white
sliderWithImages.attributedTextForFraction = { fraction in
let formatter = NumberFormatter()
formatter.maximumIntegerDigits = 3
formatter.maximumFractionDigits = 0
let string = formatter.string(from: (fraction * 800 + 100) as NSNumber) ?? ""
return NSAttributedString(string: string, attributes: [.font: UIFont.systemFont(ofSize: 12, weight: .bold), .foregroundColor: UIColor.black])
}
sliderWithImages.setMinimumImage(UIImage(named: "banana"))
sliderWithImages.setMaximumImage(UIImage(named: "cake"))
sliderWithImages.imagesColor = UIColor.white.withAlphaComponent(0.8)
sliderWithImages.setMinimumLabelAttributedText(NSAttributedString(string: "", attributes: labelTextAttributes))
sliderWithImages.setMaximumLabelAttributedText(NSAttributedString(string: "", attributes: labelTextAttributes))
sliderWithImages.fraction = 0.5
sliderWithImages.shadowOffset = CGSize(width: 0, height: 10)
sliderWithImages.shadowBlur = 5
sliderWithImages.shadowColor = UIColor(white: 0, alpha: 0.1)
sliderWithImages.contentViewColor = UIColor.purple
sliderWithImages.valueViewColor = .white
}

private func setLabelHidden(_ hidden: Bool, animated: Bool) {
Expand Down